Activiti/Activiti · error · ApplicationLoadException

Unable to load application resources

Error message

Unable to load application resources

What it means

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').

Solutions

  1. Verify the applicationsLocation property (e.g. classpath:apps/ or file:/path/apps/) is correct and the directory is readable.
  2. Fix the location string so the appended '**.zip' pattern is valid (location should end with '/').
  3. Catch ApplicationLoadException at the caller and log/propagate context about the configured location.

Example fix

// before
activiti.application.location=classpath:apps

// after
activiti.application.location=classpath:apps/
Defensive patterns

Strategy: try-catch

Validate before calling

Resource loc = resourceLoader.getResource(applicationsLocation); if (!loc.exists() || !applicationsLocation.endsWith("/")) { fail("Invalid applications location: " + applicationsLocation); }

Try / catch

try { apps = discovery.discoverApplications(); } catch (ApplicationLoadException e) { log.error("App discovery failed for location {}", location, e); throw e; }

Prevention

When it happens

Trigger: 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).

Common situations: Misconfigured applications location (bad classpath:/file: prefix, unreadable directory, network-mounted location briefly unavailable); pattern typos that produce invalid resource patterns.

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


AI-assisted analysis of Activiti/Activiti@56435b1a97 (2026-09-09). Data as JSON: /api/errors/28ad325c303e7fac. Report an issue: GitHub.

Appendix: source

Thrown at activiti-core-common/activiti-spring-application/src/main/java/org/activiti/application/ApplicationDiscovery.java:43

public class ApplicationDiscovery {

    private ResourcePatternResolver resourceLoader;
    private String applicationsLocation;

    public ApplicationDiscovery(ResourcePatternResolver resourceLoader, String applicationsLocation) {
        this.resourceLoader = resourceLoader;
        this.applicationsLocation = applicationsLocation;
    }

    public List<Resource> discoverApplications() {
        List<Resource> resources = new ArrayList<>();
        Resource resource = resourceLoader.getResource(applicationsLocation);
        if (resource.exists()) {
            try {
                resources = asList(resourceLoader.getResources(applicationsLocation + "**.zip"));
            } catch (IOException e) {
                throw new ApplicationLoadException("Unable to load application resources", e);
            }
        }
        return resources;
    }
}

View on GitHub (pinned to 56435b1a97)