{"record":{"id":"46f3ec6aa662ab9b","repo":"flowable/flowable-engine","slug":"malformed-url-url-46f3ec","errorCode":null,"errorMessage":"malformed url: ${url}","messagePattern":"malformed url: (.+?)","errorType":"exception","errorClass":"ActivitiIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/bpmn/parser/BpmnParse.java","lineNumber":252,"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 ActivitiIllegalArgumentException(\"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":234,"sourceCodeEnd":270,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/bpmn/parser/BpmnParse.java#L234-L270","documentation":"BpmnParse.sourceUrl(String) converts the string to a java.net.URL before parsing from that source. If the string is not a valid URL (MalformedURLException), it throws ActivitiIllegalArgumentException with 'malformed url: <url>'.","triggerScenarios":"Calling bpmnParse.sourceUrl(\"...\") with a string lacking a protocol (e.g. '/path/to/file.bpmn' or 'localhost:8080/x') or containing illegal URL characters.","commonSituations":"Passing a file path or resource name where a full URL is required; forgetting the http:// or file:// prefix; unencoded spaces or special characters in URLs.","solutions":["Pass a complete, properly encoded URL including scheme, e.g. new URL(\"file:///path/to/process.bpmn20.xml\")","Use sourceResource() or sourceInputStream() instead if you have a classpath resource or stream rather than a URL","Pre-encode the string with URLEncoder or use URI(String).toURL() to validate before calling"],"exampleFix":"// before\nparse.sourceUrl(\"/opt/processes/order.bpmn20.xml\");\n// after\nparse.sourceUrl(\"file:///opt/processes/order.bpmn20.xml\");\n// or for classpath resources:\nparse.sourceResource(\"processes/order.bpmn20.xml\");","handlingStrategy":"validation","validationCode":"// validate the URL string before calling\ntry {\n  new java.net.URL(url); // throws MalformedURLException if invalid\n} catch (java.net.MalformedURLException e) {\n  throw new IllegalArgumentException(\"Pass a full URL with scheme, not: \" + url);\n}","typeGuard":"static boolean isValidUrl(String s) {\n  try { new java.net.URL(s); return true; } catch (java.net.MalformedURLException e) { return false; }\n}","tryCatchPattern":"try {\n  parse.sourceUrl(url);\n} catch (ActivitiIllegalArgumentException e) {\n  if (e.getMessage().startsWith(\"malformed url:\")) { /* fix scheme/encoding */ }\n}","preventionTips":["Always include a scheme (file://, http://) when calling sourceUrl(String)","Use sourceResource() for classpath resources instead","Prefer new URI(s).toURL() which also validates encoding"],"tags":["bpmn","url","parsing","argument"],"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"}