{"record":{"id":"97cae6038f68f3ef","repo":"flowable/flowable-engine","slug":"couldn-t-open-resource-stream-e-getmessage","errorCode":null,"errorMessage":"couldn't open resource stream: <e.getMessage()>","messagePattern":"couldn't open resource stream: <e\\.getMessage\\(\\)>","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-app-engine/src/main/java/org/flowable/app/engine/AppEngines.java","lineNumber":162,"sourceCode":"            appEngineInfo = new EngineInfo(appEngineName, resourceUrlString, null);\n            appEngines.put(appEngineName, appEngine);\n            appEngineInfosByName.put(appEngineName, appEngineInfo);\n        } catch (Throwable e) {\n            LOGGER.error(\"Exception while initializing app engine: {}\", e.getMessage(), e);\n            appEngineInfo = new EngineInfo(null, resourceUrlString, ExceptionUtils.getStackTrace(e));\n        }\n        appEngineInfosByResourceUrl.put(resourceUrlString, appEngineInfo);\n        appEngineInfos.add(appEngineInfo);\n        return appEngineInfo;\n    }\n\n    protected static AppEngine buildAppEngine(URL resource) {\n        try (InputStream inputStream = resource.openStream()) {\n            AppEngineConfiguration appEngineConfiguration = AppEngineConfiguration.createAppEngineConfigurationFromInputStream(inputStream);\n            return appEngineConfiguration.buildAppEngine();\n\n        } catch (IOException e) {\n            throw new FlowableException(\"couldn't open resource stream: \" + e.getMessage(), e);\n        }\n    }\n\n    /** Get initialization results. */\n    public static List<EngineInfo> getAppEngineInfos() {\n        return appEngineInfos;\n    }\n\n    /**\n     * 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\n     * programmatically.\n     */\n    public static EngineInfo getAppEngineInfo(String appEngineName) {\n        return appEngineInfosByName.get(appEngineName);\n    }\n\n    public static AppEngine getDefaultAppEngine() {\n        return getAppEngine(NAME_DEFAULT);","sourceCodeStart":144,"sourceCodeEnd":180,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-app-engine/src/main/java/org/flowable/app/engine/AppEngines.java#L144-L180","documentation":"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.","triggerScenarios":"AppEngines.appEngine(...) → buildAppEngine(URL) when openStream() fails on the config URL (file removed, jar closed, unreadable path).","commonSituations":"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.","solutions":["Confirm the file behind the URL exists and is readable at the moment of the call.","Check the wrapped IOException message for the exact path and OS-level reason.","Rebuild/redeploy so config resources and classpath are consistent.","Call AppEngines.retry(resourceUrl) or rebuild the engine from a fresh configuration input stream."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"URL url = new URL(resourceUrl);\ntry (InputStream in = url.openStream()) { /* readable check */ }","typeGuard":null,"tryCatchPattern":"try { AppEngines.retry(resourceUrl); } catch (FlowableException e) {\n    log.error(\"Cannot open engine config stream: \" + e.getMessage(), e);\n}","preventionTips":["Confirm config files exist and are readable at call time","Rebuild/redeploy after config changes","Beware stale URLs cached in EngineInfo after redeploys","Check nested-jar URL handling in Spring Boot deployments"],"tags":["io","resource-read","engine-init"],"backgroundTag":"file-open-failed","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}