flowable/flowable-engine · error · FlowableIllegalArgumentException

malformed url: " + url

Error message

malformed url: " + url

What it means

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: ...").

Solutions

  1. Pass an absolute, well-formed URL (e.g. new File(path).toURI().toURL().toString())
  2. Use sourceResource(...) instead if you actually have a classpath resource or file path
  3. URL-encode spaces and special characters in the URL

Example fix

// before
parse.sourceUrl("/opt/processes/order.bpmn20.xml");
// after
parse.sourceUrl(new java.io.File("/opt/processes/order.bpmn20.xml").toURI().toURL().toString());
// or simply:
parse.sourceResource("order.bpmn20.xml");
Defensive patterns

Strategy: validation

Validate before calling

try { new java.net.URL(url); } catch (java.net.MalformedURLException e) { throw new IllegalArgumentException("not a valid URL: " + url); }

Try / catch

try {
    parse.sourceUrl(url);
} catch (FlowableIllegalArgumentException e) {
    if (e.getMessage().startsWith("malformed url")) parse.sourceResource(resourcePath);
}

Prevention

When it happens

Trigger: Calling bpmnParse.sourceUrl(url) with a malformed string: missing protocol ("path/to/diagram.bpmn"), unsupported scheme, spaces or illegal characters in the URL.

Common situations: Passing a classpath resource path or file path where an absolute URL is required; unencoded spaces in file URLs; typo like htp://.

Understand the failure class

Background: "Invalid URL" errors: why new URL(), URI.parse, and reqwest::Url reject your string — missing scheme, whitespace, and bad path format — this error's family across 39 libraries.

Related errors


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/5925cd5038b4157d. Report an issue: GitHub.

Appendix: source

Thrown at modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/parser/BpmnParse.java:242

    }

    public BpmnParse sourceResource(String resource) {
        return sourceResource(resource, null);
    }

    public BpmnParse sourceUrl(URL url) {
        if (name == null) {
            name(url.toString());
        }
        setStreamSource(new UrlStreamSource(url));
        return this;
    }

    public BpmnParse sourceUrl(String url) {
        try {
            return sourceUrl(new URL(url));
        } catch (MalformedURLException e) {
            throw new FlowableIllegalArgumentException("malformed url: " + url, e);
        }
    }

    public BpmnParse sourceResource(String resource, ClassLoader classLoader) {
        if (name == null) {
            name(resource);
        }
        setStreamSource(new ResourceStreamSource(resource, classLoader));
        return this;
    }

    public BpmnParse sourceString(String string) {
        if (name == null) {
            name("string");
        }
        setStreamSource(new StringStreamSource(string));
        return this;
    }

View on GitHub (pinned to d6d39ce1c6)