{"record":{"id":"6eb0edc11401989c","repo":"flowable/flowable-engine","slug":"couldn-t-open-resource-stream-e-getmessage-6eb0ed","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":"critical","filePath":"modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/DmnEngines.java","lineNumber":164,"sourceCode":"            dmnEngineInfo = new EngineInfo(dmnEngineName, resourceUrlString, null);\n            dmnEngines.put(dmnEngineName, dmnEngine);\n            dmnEngineInfosByName.put(dmnEngineName, dmnEngineInfo);\n        } catch (Throwable e) {\n            LOGGER.error(\"Exception while initializing dmn engine: {}\", e.getMessage(), e);\n            dmnEngineInfo = new EngineInfo(null, resourceUrlString, ExceptionUtils.getStackTrace(e));\n        }\n        dmnEngineInfosByResourceUrl.put(resourceUrlString, dmnEngineInfo);\n        dmnEngineInfos.add(dmnEngineInfo);\n        return dmnEngineInfo;\n    }\n\n    protected static DmnEngine buildDmnEngine(URL resource) {\n        try (InputStream inputStream = resource.openStream()) {\n            DmnEngineConfiguration dmnEngineConfiguration = DmnEngineConfiguration.createDmnEngineConfigurationFromInputStream(inputStream);\n            return dmnEngineConfiguration.buildDmnEngine();\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> getDmnEngineInfos() {\n        return dmnEngineInfos;\n    }\n\n    /**\n     * Get initialization results. Only info will we available for dmn engines which were added in the {@link DmnEngines#init()}. No {@link EngineInfo} is available for engines which were registered\n     * programmatically.\n     */\n    public static EngineInfo getDmnEngineInfo(String dmnEngineName) {\n        return dmnEngineInfosByName.get(dmnEngineName);\n    }\n\n    public static DmnEngine getDefaultDmnEngine() {\n        return getDmnEngine(NAME_DEFAULT);","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/DmnEngines.java#L146-L182","documentation":"DmnEngines.buildDmnEngine wraps the resource's URL.openStream() call; when opening the stream throws IOException (resource missing, unreadable, or connection failure), the engine rethrows it as a FlowableException. This happens during engine initialization from a configuration resource URL, so it usually means the DMN engine configuration file could not be read.","triggerScenarios":"Calling DmnEngines.initDmnEngineFromResource / buildDmnEngine with a URL whose openStream() throws IOException — e.g. a file:// URL pointing to a nonexistent or unreadable flowable.cfg.xml, or an unreachable http:// resource.","commonSituations":"Wrong classpath resource path typo in flowable.cfg.xml lookup; file deleted or moved after URL was resolved; insufficient file permissions; remote config URL down or DNS failure.","solutions":["Verify the resource URL points to an existing, readable configuration file (check the path with new File(url.toURI()).exists() or curl for http URLs).","If the resource is on the classpath, build the URL with getClass().getClassLoader().getResource(\"flowable.dmn.cfg.xml\") instead of hand-constructing a file path.","Check file permissions and that the process user can read the file.","Inspect the wrapped IOException (e.getCause()) for the underlying reason (FileNotFoundException, ConnectException, etc.)."],"exampleFix":"// before\nURL url = new URL(\"file:config/flowable.dmn.cfg.xml\"); // file missing\nDmnEngine engine = DmnEngines.buildDmnEngine(url);\n\n// after\nURL url = DmnEngines.class.getClassLoader().getResource(\"flowable.dmn.cfg.xml\");\nif (url == null) throw new IllegalStateException(\"flowable.dmn.cfg.xml not on classpath\");\nDmnEngine engine = DmnEngines.buildDmnEngine(url);","handlingStrategy":"try-catch","validationCode":"URL url = DmnEngines.class.getClassLoader().getResource(\"flowable.dmn.cfg.xml\");\nif (url == null) throw new IllegalStateException(\"DMN engine config resource not found on classpath\");","typeGuard":"if (resource == null || resource.toString().isBlank()) { throw new IllegalArgumentException(\"resource URL required\"); }","tryCatchPattern":"try {\n    DmnEngine engine = DmnEngines.buildDmnEngine(url);\n} catch (FlowableException e) {\n    Throwable cause = e.getCause(); // IOException with real reason\n    LOGGER.error(\"Cannot open DMN config resource {}: {}\", url, cause.getMessage(), cause);\n    throw new IllegalStateException(\"DMN engine init failed: bad resource\", e);\n}","preventionTips":["Resolve config resources via ClassLoader.getResource instead of hand-built file URLs","Check resource existence/readability before building the engine","Log the underlying cause chain (getCause()) for diagnosis"],"tags":["io","initialization","resource-loading","java"],"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-14T05:17:10.506Z"}