flowable/flowable-engine · error · FlowableException

couldn't open resource stream: <e.getMessage()>

Error message

couldn't open resource stream: <e.getMessage()>

What it means

buildAppEngine opens a URL stream for a discovered flowable.app.cfg.xml resource and feeds it to AppEngineConfiguration. If resource.openStream() (or reading the stream) throws IOException, it is wrapped in this FlowableException. The config resource was found but its content could not be read.

Source

Thrown at modules/flowable-app-engine/src/main/java/org/flowable/app/engine/AppEngines.java:162

            appEngineInfo = new EngineInfo(appEngineName, resourceUrlString, null);
            appEngines.put(appEngineName, appEngine);
            appEngineInfosByName.put(appEngineName, appEngineInfo);
        } catch (Throwable e) {
            LOGGER.error("Exception while initializing app engine: {}", e.getMessage(), e);
            appEngineInfo = new EngineInfo(null, resourceUrlString, ExceptionUtils.getStackTrace(e));
        }
        appEngineInfosByResourceUrl.put(resourceUrlString, appEngineInfo);
        appEngineInfos.add(appEngineInfo);
        return appEngineInfo;
    }

    protected static AppEngine buildAppEngine(URL resource) {
        try (InputStream inputStream = resource.openStream()) {
            AppEngineConfiguration appEngineConfiguration = AppEngineConfiguration.createAppEngineConfigurationFromInputStream(inputStream);
            return appEngineConfiguration.buildAppEngine();

        } catch (IOException e) {
            throw new FlowableException("couldn't open resource stream: " + e.getMessage(), e);
        }
    }

    /** Get initialization results. */
    public static List<EngineInfo> getAppEngineInfos() {
        return appEngineInfos;
    }

    /**
     * Get initialization results. Only info will we available for app engines which were added in the {@link AppEngines#init()}. No {@link EngineInfo} is available for engines which were registered
     * programmatically.
     */
    public static EngineInfo getAppEngineInfo(String appEngineName) {
        return appEngineInfosByName.get(appEngineName);
    }

    public static AppEngine getDefaultAppEngine() {
        return getAppEngine(NAME_DEFAULT);

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Confirm the file behind the URL exists and is readable at the moment of the call.
  2. Check the wrapped IOException message for the exact path and OS-level reason.
  3. Rebuild/redeploy so config resources and classpath are consistent.
  4. Call AppEngines.retry(resourceUrl) or rebuild the engine from a fresh configuration input stream.
Defensive patterns

Strategy: try-catch

Validate before calling

URL url = new URL(resourceUrl);
try (InputStream in = url.openStream()) { /* readable check */ }

Try / catch

try { AppEngines.retry(resourceUrl); } catch (FlowableException e) {
    log.error("Cannot open engine config stream: " + e.getMessage(), e);
}

Prevention

When it happens

Trigger: AppEngines.appEngine(...) → buildAppEngine(URL) when openStream() fails on the config URL (file removed, jar closed, unreadable path).

Common situations: Config file deleted after classpath scan; nested-jar URLs that can't be reopened; permission issues on the configuration file; stale resource URLs cached in appEngineInfos after a redeploy.

Understand the failure class

Background: "open() failed", "failed to open file", "cannot create file" — what a file open error means and how to fix it — this error's family across 42 libraries.

Related errors


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/97cae6038f68f3ef. Report an issue: GitHub.