{"record":{"id":"28ad325c303e7fac","repo":"Activiti/Activiti","slug":"unable-to-load-application-resources","errorCode":null,"errorMessage":"Unable to load application resources","messagePattern":"Unable to load application resources","errorType":"exception","errorClass":"ApplicationLoadException","httpStatus":null,"severity":"error","filePath":"activiti-core-common/activiti-spring-application/src/main/java/org/activiti/application/ApplicationDiscovery.java","lineNumber":43,"sourceCode":"\npublic class ApplicationDiscovery {\n\n    private ResourcePatternResolver resourceLoader;\n    private String applicationsLocation;\n\n    public ApplicationDiscovery(ResourcePatternResolver resourceLoader, String applicationsLocation) {\n        this.resourceLoader = resourceLoader;\n        this.applicationsLocation = applicationsLocation;\n    }\n\n    public List<Resource> discoverApplications() {\n        List<Resource> resources = new ArrayList<>();\n        Resource resource = resourceLoader.getResource(applicationsLocation);\n        if (resource.exists()) {\n            try {\n                resources = asList(resourceLoader.getResources(applicationsLocation + \"**.zip\"));\n            } catch (IOException e) {\n                throw new ApplicationLoadException(\"Unable to load application resources\", e);\n            }\n        }\n        return resources;\n    }\n}\n","sourceCodeStart":25,"sourceCodeEnd":49,"githubUrl":"https://github.com/Activiti/Activiti/blob/56435b1a97deeafdc09dd40074b056c89fba5a8a/activiti-core-common/activiti-spring-application/src/main/java/org/activiti/application/ApplicationDiscovery.java#L25-L49","documentation":"ApplicationDiscovery.discoverApplications() loads application ZIP resources from a configured location via a Spring ResourceLoader. If the location exists but PathMatchingResourcePatternResolver.getResources() throws an IOException while expanding the '**.zip' pattern, it wraps it in ApplicationLoadException('Unable to load application resources').","triggerScenarios":"Calling discoverApplications() when applicationsLocation is set, resource.exists() is true, but getResources(applicationsLocation + \"**.zip\") fails with IOException (e.g. malformed pattern, IO error scanning the directory).","commonSituations":"Misconfigured applications location (bad classpath:/file: prefix, unreadable directory, network-mounted location briefly unavailable); pattern typos that produce invalid resource patterns.","solutions":["Verify the applicationsLocation property (e.g. classpath:apps/ or file:/path/apps/) is correct and the directory is readable.","Fix the location string so the appended '**.zip' pattern is valid (location should end with '/').","Catch ApplicationLoadException at the caller and log/propagate context about the configured location."],"exampleFix":"// before\nactiviti.application.location=classpath:apps\n\n// after\nactiviti.application.location=classpath:apps/","handlingStrategy":"try-catch","validationCode":"Resource loc = resourceLoader.getResource(applicationsLocation); if (!loc.exists() || !applicationsLocation.endsWith(\"/\")) { fail(\"Invalid applications location: \" + applicationsLocation); }","typeGuard":null,"tryCatchPattern":"try { apps = discovery.discoverApplications(); } catch (ApplicationLoadException e) { log.error(\"App discovery failed for location {}\", location, e); throw e; }","preventionTips":["End directory locations with '/' so the '**.zip' pattern is valid.","Verify the configured location exists and is readable at startup.","Fail fast on bad configuration with a clear startup check."],"tags":["spring","io","resource-loading","configuration"],"backgroundTag":"file-read-failed","analyzedSha":"56435b1a97deeafdc09dd40074b056c89fba5a8a","analyzedAt":"2026-09-09T21:00:06.703Z","contentChangedAt":"2026-09-09T21:00:06.703Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}