{"record":{"id":"9cab97b920b0d9da","repo":"flowable/flowable-engine","slug":"couldn-t-open-resource-stream","errorCode":null,"errorMessage":"couldn't open resource stream: ","messagePattern":"couldn't open resource stream: ","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/EventRegistryEngines.java","lineNumber":162,"sourceCode":"            eventRegistryEngineInfo = new EngineInfo(eventRegistryEngineName, resourceUrlString, null);\n            eventRegistryEngines.put(eventRegistryEngineName, eventRegistryEngine);\n            eventRegistryEngineInfosByName.put(eventRegistryEngineName, eventRegistryEngineInfo);\n        } catch (Throwable e) {\n            LOGGER.error(\"Exception while initializing event registry engine: {}\", e.getMessage(), e);\n            eventRegistryEngineInfo = new EngineInfo(null, resourceUrlString, ExceptionUtils.getStackTrace(e));\n        }\n        eventRegistryEngineInfosByResourceUrl.put(resourceUrlString, eventRegistryEngineInfo);\n        eventRegistryEngineInfos.add(eventRegistryEngineInfo);\n        return eventRegistryEngineInfo;\n    }\n\n    protected static EventRegistryEngine buildEventRegistryEngine(URL resource) {\n        try (InputStream inputStream = resource.openStream()) {\n            EventRegistryEngineConfiguration eventRegistryEngineConfiguration = EventRegistryEngineConfiguration.createEventRegistryEngineConfigurationFromInputStream(inputStream);\n            return eventRegistryEngineConfiguration.buildEventRegistryEngine();\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> getEventRegistryEngineInfos() {\n        return eventRegistryEngineInfos;\n    }\n\n    /**\n     * Get initialization results. Only info will we available for event registry engines which were added in the \n     * {@link EventRegistryEngines#init()}. No {@link EngineInfo} is available for engines which were registered\n     * programmatically.\n     */\n    public static EngineInfo getEventRegistryEngineInfo(String eventRegistryEngineName) {\n        return eventRegistryEngineInfosByName.get(eventRegistryEngineName);\n    }\n\n    public static EventRegistryEngine getDefaultEventRegistryEngine() {","sourceCodeStart":144,"sourceCodeEnd":180,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/EventRegistryEngines.java#L144-L180","documentation":"Thrown by buildEventRegistryEngine when URL.openStream() on the configuration resource throws IOException, i.e. the resource cannot be opened or read. The configuration XML was located as a URL but its stream is unavailable, so the engine cannot be constructed.","triggerScenarios":"EventRegistryEngines builds an engine from a URL whose openStream() fails: file removed/moved after enumeration, unreadable permissions, or an unreachable remote URL.","commonSituations":"Classpath resource deleted after being listed; JAR repackaged without the config file; filesystem permissions changed; network-mounted resource temporarily unavailable.","solutions":["Confirm the resource exists and is readable at the exact URL printed by the wrapped IOException","If it's a classpath resource, verify it is packaged in the JAR/WAR (unzip -l | grep eventregistry)","Fix file permissions or re-add the config file and redeploy/restart"],"exampleFix":"// before\nURL url = getClass().getResource(\"/flowable-eventregistry.cfg.xml\"); // null or stale path\nEventRegistryEngines.buildEventRegistryEngine(url);\n// after\nURL url = getClass().getResource(\"/flowable-eventregistry.cfg.xml\");\nif (url == null) throw new IllegalStateException(\"event registry config missing from classpath\");\nEventRegistryEngines.buildEventRegistryEngine(url);","handlingStrategy":"validation","validationCode":"URL u = getClass().getResource(\"/flowable-eventregistry.cfg.xml\");\nif (u == null) throw new IllegalStateException(\"config resource not on classpath\");\ntry (InputStream probe = u.openStream()) { if (probe.read() == -1) throw new IllegalStateException(\"config resource is empty\"); }","typeGuard":null,"tryCatchPattern":"try {\n    EventRegistryEngines.buildEventRegistryEngine(url);\n} catch (FlowableException e) {\n    throw new IllegalStateException(\"cannot read event registry config at \" + url, e);\n}","preventionTips":["Verify config files are packaged (check the built JAR/WAR contents)","Use getResource() null-check before building engines from URLs","Keep resources readable by the process user; avoid network-mounted configs"],"tags":["flowable","io","resource","classpath"],"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"}