{"record":{"id":"75df1b4ab471dee9","repo":"flowable/flowable-engine","slug":"couldn-t-auto-deploy-resource","errorCode":null,"errorMessage":"couldn't auto deploy resource '': ","messagePattern":"couldn't auto deploy resource '': ","errorType":"exception","errorClass":"ActivitiException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-spring/src/main/java/org/activiti/spring/autodeployment/DefaultAutoDeploymentStrategy.java","lineNumber":58,"sourceCode":"\n    @Override\n    public void deployResources(final String deploymentNameHint, final Resource[] resources, final RepositoryService repositoryService) {\n\n        // Create a single deployment for all resources using the name hint as\n        // the literal name\n        final DeploymentBuilder deploymentBuilder = repositoryService.createDeployment().enableDuplicateFiltering().name(deploymentNameHint);\n\n        for (final Resource resource : resources) {\n            final String resourceName = determineResourceName(resource);\n\n            try {\n                if (resourceName.endsWith(\".bar\") || resourceName.endsWith(\".zip\") || resourceName.endsWith(\".jar\")) {\n                    deploymentBuilder.addZipInputStream(new ZipInputStream(resource.getInputStream()));\n                } else {\n                    deploymentBuilder.addInputStream(resourceName, resource.getInputStream());\n                }\n            } catch (IOException e) {\n                throw new ActivitiException(\"couldn't auto deploy resource '\" + resource + \"': \" + e.getMessage(), e);\n            }\n        }\n\n        deploymentBuilder.deploy();\n\n    }\n\n}\n","sourceCodeStart":40,"sourceCodeEnd":67,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-spring/src/main/java/org/activiti/spring/autodeployment/DefaultAutoDeploymentStrategy.java#L40-L67","documentation":"Thrown by DefaultAutoDeploymentStrategy.deployResources when reading a classpath resource designated for auto-deployment fails with an IOException. The resource name and IO error message are wrapped in an ActivitiException and the deployment aborts.","triggerScenarios":"processEngineConfiguration.setDeploymentResources(...) containing a Spring Resource whose getInputStream() fails at startup — e.g. missing file inside a JAR/WAR, unreadable path, or a directory instead of a file.","commonSituations":"Moved/renamed .bpmn/.bar files under the configured deployment folder; fat-jar packaging changes breaking classpath resource resolution; file permissions; typo in the resource pattern.","solutions":["Verify the resource paths/patterns point to existing, readable files (check the packaged jar/war contents).","Fix packaging so the process definitions are included in the artifact (maven/gradle resource filtering/excludes).","Check filesystem permissions on the resource location.","Catch ActivitiException during engine bootstrap and log/fail with the wrapped IOException cause.","Use Spring's ResourceLoader abstraction correctly (classpath*: patterns) when assembling DeploymentResources."],"exampleFix":"// before\ncfg.setDeploymentResources(new Resource[]{ new FileSystemResource(\"processes/order.bpmn\") }); // missing on server\n// after\ncfg.setDeploymentResources(new Resource[]{ new ClassPathResource(\"processes/order.bpmn\") });","handlingStrategy":"try-catch","validationCode":"for (Resource r : deploymentResources) {\n  if (!r.exists() || !r.isReadable()) throw new IllegalStateException(\"Auto-deploy resource missing/unreadable: \" + r);\n}","typeGuard":null,"tryCatchPattern":"try { buildEngine(); } catch (ActivitiException e) { log.error(\"Auto-deployment failed: {}\", e.getCause(), e); throw e; }","preventionTips":["Verify resource patterns resolve to packaged files (jar tf ...) before deployment","Include .bpmn/.bar files in build resources configuration","Prefer classpath resources over filesystem paths in packaged apps","Validate resources at startup with a smoke test"],"tags":["spring","auto-deployment","io"],"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"}