{"record":{"id":"7b8837979b6e8abf","repo":"flowable/flowable-engine","slug":"failed-to-read-resource-resource-7b8837","errorCode":null,"errorMessage":"Failed to read resource ${resource}","messagePattern":"Failed to read resource (.+?)","errorType":"exception","errorClass":"UncheckedIOException","httpStatus":null,"severity":"error","filePath":"modules/flowable-spring-boot/flowable-spring-boot-starters/flowable-spring-boot-autoconfigure/src/main/java/org/flowable/spring/boot/aot/cmmn/FlowableCmmnAutoDeployBeanFactoryInitializationAotProcessor.java","lineNumber":93,"sourceCode":"\n    static class CmmnAutoDeployResourceContribution extends BaseAutoDeployResourceContribution {\n\n        protected final ConfigurableListableBeanFactory beanFactory;\n\n        public CmmnAutoDeployResourceContribution(String locationPrefix, Collection<String> locationSuffixes, ConfigurableListableBeanFactory beanFactory) {\n            super(locationPrefix, locationSuffixes);\n            this.beanFactory = beanFactory;\n        }\n\n        @Override\n        protected void applyToResource(ClassPathResource resource, RuntimeHints hints) {\n            super.applyToResource(resource, hints);\n            CmmnXmlConverter cmmXmlConverter = new CmmnXmlConverter();\n            CmmnModel cmmnModel = cmmXmlConverter.convertToCmmnModel(() -> {\n                try {\n                    return resource.getInputStream();\n                } catch (IOException e) {\n                    throw new UncheckedIOException(\"Failed to read resource \" + resource, e);\n                }\n            }, false, false);\n            Collection<ServiceTask> serviceTasks = cmmnModel.getPrimaryCase().findPlanItemDefinitionsOfType(ServiceTask.class);\n            for (ServiceTask serviceTask : serviceTasks) {\n                if (ImplementationType.IMPLEMENTATION_TYPE_DELEGATEEXPRESSION.equals(serviceTask.getImplementationType())) {\n                    String expression = serviceTask.getImplementation();\n                    String expressionWithoutDelimiters = expression.substring(2);\n                    expressionWithoutDelimiters = expressionWithoutDelimiters.substring(0, expressionWithoutDelimiters.length() - 1);\n                    String beanName = expressionWithoutDelimiters;\n                    try {\n                        BeanDefinition beanDefinition = beanFactory.getBeanDefinition(beanName);\n                        String beanClassName = beanDefinition.getBeanClassName();\n                        if (StringUtils.isNotEmpty(beanClassName)) {\n                            hints.reflection().registerType(TypeReference.of(beanClassName), MemberCategory.values());\n                            logger.debug(\"Registering hint for bean name [{}] for service task {} in {}\", beanName, serviceTask.getId(), resource);\n                        } else {\n                            logger.debug(\"No bean class name for bean name [{}] for service task {} in {}\", beanName, serviceTask.getId(), resource);\n                        }","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-spring-boot/flowable-spring-boot-starters/flowable-spring-boot-autoconfigure/src/main/java/org/flowable/spring/boot/aot/cmmn/FlowableCmmnAutoDeployBeanFactoryInitializationAotProcessor.java#L75-L111","documentation":"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.","triggerScenarios":"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).","commonSituations":"GraalVM native builds with corrupted or partially packaged jars; resources in nested jars not resolvable at AOT time; filesystem permissions; disk full on CI.","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"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"ClassPathResource r = new ClassPathResource(\"cmmn/my-case.cmmn.xml\");\nif (!r.exists() || !r.getFile().canRead()) {\n    throw new IllegalStateException(\"CMMN resource missing or unreadable: \" + r);\n}","typeGuard":null,"tryCatchPattern":"try (InputStream in = resource.getInputStream()) {\n    // parse model\n} catch (UncheckedIOException | IOException e) {\n    logger.error(\"Cannot read CMMN resource {}\", resource, e);\n}","preventionTips":["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"],"tags":["aot","native-image","cmmn","io","resource"],"backgroundTag":"file-read-failed","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}