flowable/flowable-engine · error · UncheckedIOException
Failed to read resource ${resource}
Error message
Failed to read resource ${resource} What it means
During Spring AOT processing, FlowableCmmnAutoDeployBeanFactoryInitializationAotProcessor.applyToResource parses each auto-deploy CMMN resource to find delegate-expression service tasks and register reflection hints. If resource.getInputStream() throws IOException, it is wrapped as UncheckedIOException 'Failed to read resource <resource>'. The resource was found but its content could not be opened/read.
Source
Thrown at modules/flowable-spring-boot/flowable-spring-boot-starters/flowable-spring-boot-autoconfigure/src/main/java/org/flowable/spring/boot/aot/cmmn/FlowableCmmnAutoDeployBeanFactoryInitializationAotProcessor.java:93
static class CmmnAutoDeployResourceContribution extends BaseAutoDeployResourceContribution {
protected final ConfigurableListableBeanFactory beanFactory;
public CmmnAutoDeployResourceContribution(String locationPrefix, Collection<String> locationSuffixes, ConfigurableListableBeanFactory beanFactory) {
super(locationPrefix, locationSuffixes);
this.beanFactory = beanFactory;
}
@Override
protected void applyToResource(ClassPathResource resource, RuntimeHints hints) {
super.applyToResource(resource, hints);
CmmnXmlConverter cmmXmlConverter = new CmmnXmlConverter();
CmmnModel cmmnModel = cmmXmlConverter.convertToCmmnModel(() -> {
try {
return resource.getInputStream();
} catch (IOException e) {
throw new UncheckedIOException("Failed to read resource " + resource, e);
}
}, false, false);
Collection<ServiceTask> serviceTasks = cmmnModel.getPrimaryCase().findPlanItemDefinitionsOfType(ServiceTask.class);
for (ServiceTask serviceTask : serviceTasks) {
if (ImplementationType.IMPLEMENTATION_TYPE_DELEGATEEXPRESSION.equals(serviceTask.getImplementationType())) {
String expression = serviceTask.getImplementation();
String expressionWithoutDelimiters = expression.substring(2);
expressionWithoutDelimiters = expressionWithoutDelimiters.substring(0, expressionWithoutDelimiters.length() - 1);
String beanName = expressionWithoutDelimiters;
try {
BeanDefinition beanDefinition = beanFactory.getBeanDefinition(beanName);
String beanClassName = beanDefinition.getBeanClassName();
if (StringUtils.isNotEmpty(beanClassName)) {
hints.reflection().registerType(TypeReference.of(beanClassName), MemberCategory.values());
logger.debug("Registering hint for bean name [{}] for service task {} in {}", beanName, serviceTask.getId(), resource);
} else {
logger.debug("No bean class name for bean name [{}] for service task {} in {}", beanName, serviceTask.getId(), resource);
}View on GitHub (pinned to d6d39ce1c6)
Solutions
- Rebuild the project (clean install) to regenerate a consistent jar with the CMMN resources
- Verify the .cmmn/.cmmn.xml files are intact and readable inside the jar (unzip -t)
- Check CI filesystem permissions and disk space
- Update Spring Boot/Flowable versions if nested-jar stream resolution is the culprit
Defensive patterns
Strategy: try-catch
Validate before calling
ClassPathResource r = new ClassPathResource("cmmn/my-case.cmmn.xml");
if (!r.exists() || !r.getFile().canRead()) {
throw new IllegalStateException("CMMN resource missing or unreadable: " + r);
} Try / catch
try (InputStream in = resource.getInputStream()) {
// parse model
} catch (UncheckedIOException | IOException e) {
logger.error("Cannot read CMMN resource {}", resource, e);
} Prevention
- Clean-rebuild artifacts before AOT/native builds to avoid stale jars
- Validate .cmmn files are packaged correctly (jar tf target/*.jar)
- Check build agent disk space and permissions
When it happens
Trigger: AOT (native image) build where a CmmnXmlConverter supplier opens a classpath resource's stream and the underlying file/jar entry cannot be read (broken jar entry, deleted temp resource, permission/IO problem).
Common situations: GraalVM native builds with corrupted or partially packaged jars; resources in nested jars not resolvable at AOT time; filesystem permissions; disk full on CI.
Understand the failure class
Background: "failed to read file", EACCES, ENOENT and "could not read <path>" errors: when a program can't read a file from disk — this error's family across 49 libraries.
Related errors
- Failed to read resource ${resource}
- Failed to read mappings
- Failed to read mapper from
- Failed to find resources for ${path}
- problem retrieving flowable.cmmn.cfg.xml resources on the cl
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/7b8837979b6e8abf.
Report an issue: GitHub.