flowable/flowable-engine · error · FlowableException
malformed url
Error message
malformed url: ${url} What it means
EventDefinitionParse.sourceUrl(String) converts the given string into a java.net.URL to use as the parse source. If the string is not a well-formed URL (bad protocol syntax, illegal characters, unknown scheme), java.net.URL throws MalformedURLException, which is rethrown as a FlowableException with the offending url in the message.
Solutions
- Fix the url string to be a fully valid absolute URL, e.g. add the scheme: 'https://host/path' instead of 'host/path'
- If you meant a classpath/file resource, use sourceResource(resource) instead of sourceUrl(url)
- Pre-validate with try { new URL(url); } catch (MalformedURLException e) { ... } and log the reason
- URL-encode illegal characters (spaces -> %20) before passing
Example fix
// before
parse.sourceUrl("events/order-event.json");
// after
parse.sourceResource("events/order-event.json");
// or a valid URL:
parse.sourceUrl("https://config.example.com/events/order-event.json"); Defensive patterns
Strategy: validation
Validate before calling
boolean isValidUrl(String s) {
if (s == null) return false;
try { new java.net.URL(s); return true; } catch (java.net.MalformedURLException e) { return false; }
} Type guard
boolean isUsableUrl(String s) { return s != null && s.matches("^[a-zA-Z][a-zA-Z0-9+.-]*:.*"); } Try / catch
try {
parse.sourceUrl(url);
} catch (org.flowable.common.engine.api.FlowableException e) {
throw new IllegalArgumentException("Not a valid URL: " + url, e);
} Prevention
- Prefer sourceResource for classpath/file resources; reserve sourceUrl for real http(s)/file URLs
- Always include the scheme in URL strings
- Validate URLs in configuration at startup, not at parse time
When it happens
Trigger: Calling EventDefinitionParse.sourceUrl(String) with a string that fails new URL(url) parsing: missing protocol (e.g. 'resources/events.json'), typos in scheme ('http:/'), spaces or other illegal characters, or an unsupported scheme.
Common situations: Hardcoded resource paths passed instead of URLs; environment-specific config where a base URL is empty or mis-concatenated; users confusing sourceResource (classpath/file resource) with sourceUrl.
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.
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
Related errors
- Invalid channel definition id : null
- Invalid event definition id : null
- invalid: multiple sources
- no channel definitions deployed with key
- no deployed channel definition found with id
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/b18f7d8a6d2ba915.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/parser/EventDefinitionParse.java:131
public EventDefinitionParse setSourceSystemId(String sourceSystemId) {
this.sourceSystemId = sourceSystemId;
return this;
}
public EventDefinitionParse sourceUrl(URL url) {
if (name == null) {
name(url.toString());
}
setStreamSource(new UrlStreamSource(url));
return this;
}
public EventDefinitionParse sourceUrl(String url) {
try {
return sourceUrl(new URL(url));
} catch (MalformedURLException e) {
throw new FlowableException("malformed url: " + url, e);
}
}
public EventDefinitionParse sourceResource(String resource) {
if (name == null) {
name(resource);
}
setStreamSource(new ResourceStreamSource(resource));
return this;
}
public EventDefinitionParse sourceString(String string) {
if (name == null) {
name("string");
}
setStreamSource(new StringStreamSource(string));
return this;
}View on GitHub (pinned to d6d39ce1c6)