{"record":{"id":"56ffe95e92584419","repo":"flowable/flowable-engine","slug":"invalid-url-resourceurl-56ffe9","errorCode":null,"errorMessage":"invalid url: ${resourceUrl}","messagePattern":"invalid url: (.+?)","errorType":"exception","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/ProcessEngines.java","lineNumber":227,"sourceCode":"     * @param processEngineName\n     *            is the name of the process engine or null for the default process engine.\n     */\n    public static ProcessEngine getProcessEngine(String processEngineName) {\n        if (!isInitialized()) {\n            init();\n        }\n        return processEngines.get(processEngineName);\n    }\n\n    /**\n     * retries to initialize a process engine that previously failed.\n     */\n    public static EngineInfo retry(String resourceUrl) {\n        LOGGER.debug(\"retying initializing of resource {}\", resourceUrl);\n        try {\n            return initProcessEngineFromResource(new URL(resourceUrl));\n        } catch (MalformedURLException e) {\n            throw new FlowableIllegalArgumentException(\"invalid url: \" + resourceUrl, e);\n        }\n    }\n\n    /**\n     * provides access to process engine to application clients in a managed server environment.\n     */\n    public static Map<String, ProcessEngine> getProcessEngines() {\n        return processEngines;\n    }\n\n    /**\n     * closes all process engines. This method should be called when the server shuts down.\n     */\n    public static synchronized void destroy() {\n        if (isInitialized()) {\n            Map<String, ProcessEngine> engines = new HashMap<>(processEngines);\n            processEngines = new HashMap<>();\n","sourceCodeStart":209,"sourceCodeEnd":245,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/ProcessEngines.java#L209-L245","documentation":"ProcessEngines.retry(String resourceUrl) converts its argument to a URL to re-run engine initialization from that resource. If the string is not a well-formed URL (e.g. a bare file path or typo), MalformedURLException is wrapped in FlowableIllegalArgumentException('invalid url: ...').","triggerScenarios":"Calling ProcessEngines.retry() with a resourceUrl string that came from outside ProcessEngines' own EngineInfo records — a relative path, 'flowable.cfg.xml', or a URL with illegal characters (unescaped spaces, bad scheme).","commonSituations":"Manually storing/persisting the resource URL and corrupting it; passing a filesystem path instead of the absolute URL recorded by EngineInfo; spaces in directory names never URL-encoded.","solutions":["Pass the exact resource.toString() URL from the original EngineInfo (e.g. file:/path/flowable.cfg.xml)","Encode the path properly or construct the URL programmatically: new File(path).toURI().toURL()","Check the MalformedURLException cause for which part of the URL is malformed (usually no protocol)"],"exampleFix":"// before\nProcessEngines.retry(\"/opt/app/flowable.cfg.xml\");\n\n// after\nProcessEngines.retry(new File(\"/opt/app/flowable.cfg.xml\").toURI().toURL().toString());","handlingStrategy":"validation","validationCode":"try {\n    new URL(resourceUrl);\n} catch (MalformedURLException e) {\n    throw new IllegalArgumentException(\"retry() needs a well-formed URL, got: \" + resourceUrl);\n}","typeGuard":"boolean isWellFormedUrl(String s) {\n    try { new URL(s); return true; } catch (MalformedURLException e) { return false; }\n}","tryCatchPattern":null,"preventionTips":["Only pass resource.toString() URLs obtained from EngineInfo","Convert filesystem paths with File.toURI().toURL() rather than string concatenation"],"tags":["flowable","url","engine-init"],"backgroundTag":"invalid-url","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}