{"record":{"id":"2dd195fb9cd6df39","repo":"flowable/flowable-engine","slug":"couldn-t-auto-deploy-resource-2dd195","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/ResourceParentFolderAutoDeploymentStrategy.java","lineNumber":73,"sourceCode":"        final Map<String, Set<Resource>> resourcesMap = createMap(resources);\n\n        for (final Entry<String, Set<Resource>> group : resourcesMap.entrySet()) {\n\n            final String deploymentName = determineDeploymentName(deploymentNameHint, group.getKey());\n\n            final DeploymentBuilder deploymentBuilder = repositoryService.createDeployment().enableDuplicateFiltering().name(deploymentName);\n\n            for (final Resource resource : group.getValue()) {\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            deploymentBuilder.deploy();\n        }\n\n    }\n\n    private Map<String, Set<Resource>> createMap(final Resource[] resources) {\n        final Map<String, Set<Resource>> resourcesMap = new HashMap<>();\n\n        for (final Resource resource : resources) {\n            final String parentFolderName = determineGroupName(resource);\n            if (resourcesMap.get(parentFolderName) == null) {\n                resourcesMap.put(parentFolderName, new HashSet<>());\n            }\n            resourcesMap.get(parentFolderName).add(resource);\n        }\n        return resourcesMap;","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-spring/src/main/java/org/activiti/spring/autodeployment/ResourceParentFolderAutoDeploymentStrategy.java#L55-L91","documentation":"Thrown by the Spring auto-deployment strategy (ResourceParentFolderAutoDeploymentStrategy) when an IOException occurs while reading a Spring resource being auto-deployed to the Flowable/Activiti process engine. The strategy wraps resource.getInputStream() failures in an ActivitiException so deployment aborts rather than silently skipping the resource. The message interpolates the resource (here empty in the log) and the underlying IO error.","triggerScenarios":"Spring context startup with process auto-deployment enabled and resource.getInputStream() throws IOException — e.g. the resource is a directory, was removed between scan and read, is unreadable due to file permissions, or lives in a jar that cannot be opened.","commonSituations":"applicationContext misconfiguration pointing engineConfiguration deploymentResources at a non-existent/empty folder pattern; deploying from an exploded directory that gets cleaned during build; classpath resource packaged inside a corrupt or unreadable jar; running with restricted filesystem permissions.","solutions":["Verify the deploymentResources pattern in the Spring EngineConfiguration matches real, readable files (check logs for which resource failed).","Fix filesystem permissions or restore the missing/corrupt resource file.","If the folder may legitimately be empty or missing, change the strategy/property so empty resource sets skip deployment instead of failing.","Rebuild/repackage the jar if the resource resides in a damaged artifact."],"exampleFix":"// before\n<property name=\"deploymentResources\" value=\"classpath*:/processes/*.bpmn20.xml\" />\n// after\n<!-- ensure the folder exists and pattern matches actual files -->\n<property name=\"deploymentResources\" value=\"classpath*:/processes/*.bpmn.xml\" />","handlingStrategy":"validation","validationCode":"org.springframework.core.io.Resource[] resources = appCtx.getResources(\"classpath*:/processes/*.bpmn20.xml\");\nfor (Resource r : resources) {\n    if (!r.exists() || !r.isReadable()) throw new IllegalStateException(\"Unreadable deployment resource: \" + r);\n}","typeGuard":null,"tryCatchPattern":"try { engineConfiguration.setDeploymentResources(resources); } catch (ActivitiException e) { log.error(\"Auto-deploy failed: {}\", e.getMessage(), e); }","preventionTips":["Verify deployment resource patterns resolve to existing files before startup (integration test with getResources).","Keep process resource files inside jars verified at build time.","Avoid cleaning resource directories while the application is starting."],"tags":["spring","auto-deployment","io","resource-loading"],"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"}