{"record":{"id":"5925cd5038b4157d","repo":"flowable/flowable-engine","slug":"malformed-url-url-5925cd","errorCode":null,"errorMessage":"malformed url: \" + url","messagePattern":"malformed url: \" \\+ url","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/parser/BpmnParse.java","lineNumber":242,"sourceCode":"    }\n\n    public BpmnParse sourceResource(String resource) {\n        return sourceResource(resource, null);\n    }\n\n    public BpmnParse sourceUrl(URL url) {\n        if (name == null) {\n            name(url.toString());\n        }\n        setStreamSource(new UrlStreamSource(url));\n        return this;\n    }\n\n    public BpmnParse sourceUrl(String url) {\n        try {\n            return sourceUrl(new URL(url));\n        } catch (MalformedURLException e) {\n            throw new FlowableIllegalArgumentException(\"malformed url: \" + url, e);\n        }\n    }\n\n    public BpmnParse sourceResource(String resource, ClassLoader classLoader) {\n        if (name == null) {\n            name(resource);\n        }\n        setStreamSource(new ResourceStreamSource(resource, classLoader));\n        return this;\n    }\n\n    public BpmnParse sourceString(String string) {\n        if (name == null) {\n            name(\"string\");\n        }\n        setStreamSource(new StringStreamSource(string));\n        return this;\n    }","sourceCodeStart":224,"sourceCodeEnd":260,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/parser/BpmnParse.java#L224-L260","documentation":"BpmnParse.sourceUrl(String) converts a URL string to java.net.URL before parsing. A string that is not a valid absolute URL (no protocol, illegal characters) throws MalformedURLException, which is wrapped in FlowableIllegalArgumentException(\"malformed url: ...\").","triggerScenarios":"Calling bpmnParse.sourceUrl(url) with a malformed string: missing protocol (\"path/to/diagram.bpmn\"), unsupported scheme, spaces or illegal characters in the URL.","commonSituations":"Passing a classpath resource path or file path where an absolute URL is required; unencoded spaces in file URLs; typo like htp://.","solutions":["Pass an absolute, well-formed URL (e.g. new File(path).toURI().toURL().toString())","Use sourceResource(...) instead if you actually have a classpath resource or file path","URL-encode spaces and special characters in the URL"],"exampleFix":"// before\nparse.sourceUrl(\"/opt/processes/order.bpmn20.xml\");\n// after\nparse.sourceUrl(new java.io.File(\"/opt/processes/order.bpmn20.xml\").toURI().toURL().toString());\n// or simply:\nparse.sourceResource(\"order.bpmn20.xml\");","handlingStrategy":"validation","validationCode":"try { new java.net.URL(url); } catch (java.net.MalformedURLException e) { throw new IllegalArgumentException(\"not a valid URL: \" + url); }","typeGuard":null,"tryCatchPattern":"try {\n    parse.sourceUrl(url);\n} catch (FlowableIllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"malformed url\")) parse.sourceResource(resourcePath);\n}","preventionTips":["Use File.toURI().toURL() to build URLs from paths","Use sourceResource for classpath entries instead of sourceUrl","URL-encode spaces and special characters"],"tags":["url","parsing","invalid-url-format"],"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-18T11:17:12.947Z"}