{"record":{"id":"cd269f52d1279960","repo":"flowable/flowable-engine","slug":"invalid-url-resourceurl-cd269f","errorCode":null,"errorMessage":"invalid url: {resourceUrl}","messagePattern":"invalid url: (.+?)","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/CmmnEngines.java","lineNumber":204,"sourceCode":"     * @param cmmnEngineName\n     *            is the name of the cmmn engine or null for the default cmmn engine.\n     */\n    public static CmmnEngine getCmmnEngine(String cmmnEngineName) {\n        if (!isInitialized()) {\n            init();\n        }\n        return cmmnEngines.get(cmmnEngineName);\n    }\n\n    /**\n     * retries to initialize a cmmn engine that previously failed.\n     */\n    public static EngineInfo retry(String resourceUrl) {\n        LOGGER.debug(\"retying initializing of resource {}\", resourceUrl);\n        try {\n            return initCmmnEngineFromResource(new URL(resourceUrl));\n        } catch (MalformedURLException e) {\n            throw new FlowableException(\"invalid url: \" + resourceUrl, e);\n        }\n    }\n\n    /**\n     * provides access to cmmn engine to application clients in a managed server environment.\n     */\n    public static Map<String, CmmnEngine> getCmmnEngines() {\n        return cmmnEngines;\n    }\n\n    /**\n     * closes all cmmn engines. This method should be called when the server shuts down.\n     */\n    public static synchronized void destroy() {\n        if (isInitialized()) {\n            Map<String, CmmnEngine> engines = new HashMap<>(cmmnEngines);\n            cmmnEngines = new HashMap<>();\n","sourceCodeStart":186,"sourceCodeEnd":222,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/CmmnEngines.java#L186-L222","documentation":"Thrown by CmmnEngines.retry when the given resourceUrl string cannot be parsed into a java.net.URL (MalformedURLException). It indicates a malformed URL passed to engine re-initialization, and wraps the original exception.","triggerScenarios":"Calling CmmnEngines.retry(String resourceUrl) with a string that is not a valid absolute URL (missing protocol, illegal characters, spaces).","commonSituations":"Passing a bare file path like 'flowable.cfg.xml' or '/etc/flowable.cfg.xml' instead of 'file:/...' URL; reading the resource URL from an environment variable or config property with a typo; missing 'classpath:' style handling before constructing java.net.URL.","solutions":["Convert plain paths to a proper URL, e.g. new File(path).toURI().toURL()","Use ClassLoader.getResource(name).toString() instead of hand-building the URL string","Validate the string starts with a known protocol (file:, http:, etc.) before calling retry","Inspect the wrapped MalformedURLException message for the exact syntax problem"],"exampleFix":"// before\nEngineInfo info = CmmnEngines.retry(\"/conf/flowable.cfg.xml\");\n// after\nURL url = new File(\"/conf/flowable.cfg.xml\").toURI().toURL();\nEngineInfo info = CmmnEngines.retry(url.toString());","handlingStrategy":"type-guard","validationCode":"try { new java.net.URL(resourceUrl); } catch (MalformedURLException e) { throw new IllegalArgumentException(\"bad resource url: \" + resourceUrl, e); }","typeGuard":"boolean isValidUrl(String s) { try { new java.net.URL(s); return true; } catch (MalformedURLException e) { return false; } }","tryCatchPattern":"try { return CmmnEngines.retry(resourceUrl); } catch (FlowableException e) { log.error(\"invalid url {}, cause: {}\", resourceUrl, e.getCause()); }","preventionTips":["Derive URLs from File.toURI().toURL() or ClassLoader.getResource","Never pass raw filesystem paths as URL strings","Log the offending URL string when initializing from config"],"tags":["java","url","initialization"],"backgroundTag":"invalid-url-format","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"}