flowable/flowable-engine · error · FlowableIllegalArgumentException

Unsupported multipart mode

Error message

Unsupported multipart mode: ${mode}. Supported values are: STRICT, BROWSER_COMPATIBLE, LEGACY, EXTENDED

What it means

The HttpClient 5.x Flowable client resolves an optional configured multipart mode into Apache's `HttpMultipartMode` enum. When the configured `mode` string (upper-cased) does not map to STRICT, BROWSER_COMPATIBLE, LEGACY, or EXTENDED, `resolveMultipartMode` throws this `FlowableIllegalArgumentException`.

Solutions

  1. Set the multipart mode to exactly one of STRICT, BROWSER_COMPATIBLE, LEGACY, or EXTENDED (case-insensitive, no extra characters).
  2. Remove the multipart-mode setting entirely to get the default (STRICT).
  3. Trim/normalize the config value at load time if it comes from user-supplied properties.

Example fix

// before (config)
multipart-mode=RFC6532

// after
multipart-mode=STRICT
Defensive patterns

Strategy: validation

Validate before calling

Set<String> allowed = Set.of("STRICT", "BROWSER_COMPATIBLE", "LEGACY", "EXTENDED");
if (mode != null && !allowed.contains(mode.trim().toUpperCase(Locale.ROOT))) {
    throw new IllegalArgumentException("multipart mode must be one of " + allowed + ", got: " + mode);
}

Try / catch

try {
    client = new ApacheHttpComponents5FlowableHttpClient(builder.build());
} catch (FlowableIllegalArgumentException e) {
    if (e.getMessage().startsWith("Unsupported multipart mode")) {
        log.error("Fix multipart-mode config to STRICT|BROWSER_COMPATIBLE|LEGACY|EXTENDED");
    }
    throw e;
}

Prevention

When it happens

Trigger: Constructing/configuring `ApacheHttpComponents5FlowableHttpClient` with a multipart mode option set to an unrecognized value such as "RFC6532", "browser", "strict " (trailing space), or any misspelling.

Common situations: Copy-pasting multipart-mode settings from HttpClient 4.x docs that mention modes not in this switch; typos or wrong casing plus stray whitespace in YAML/properties config.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


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

Appendix: source

Thrown at modules/flowable-http-common/src/main/java/org/flowable/http/common/impl/apache/client5/ApacheHttpComponents5FlowableHttpClient.java:173

    public ApacheHttpComponents5FlowableHttpClient(HttpAsyncClient client, int socketTimeout, int connectTimeout,
            int connectionRequestTimeout) {
        this.client = client;
        this.multipartMode = HttpMultipartMode.STRICT;
        this.socketTimeout = socketTimeout;
        this.connectTimeout = connectTimeout;
        this.connectionRequestTimeout = connectionRequestTimeout;
    }

    protected static HttpMultipartMode resolveMultipartMode(String mode) {
        if (mode == null) {
            return HttpMultipartMode.STRICT;
        }
        return switch (mode.toUpperCase()) {
            case "BROWSER_COMPATIBLE", "LEGACY" -> HttpMultipartMode.LEGACY;
            case "STRICT" -> HttpMultipartMode.STRICT;
            case "EXTENDED" -> HttpMultipartMode.EXTENDED;
            default -> throw new FlowableIllegalArgumentException("Unsupported multipart mode: " + mode
                    + ". Supported values are: STRICT, BROWSER_COMPATIBLE, LEGACY, EXTENDED");
        };
    }

    public void close() {
        if (closeClient && client instanceof ModalCloseable) {
            ((ModalCloseable) client).close(CloseMode.GRACEFUL);
        }
    }

    @Override
    public AsyncExecutableHttpRequest prepareRequest(HttpRequest requestInfo) {
        try {
            AsyncRequestBuilder request;
            URI uri = createUri(requestInfo.getUrl());
            switch (requestInfo.getMethod()) {
                case "GET": {
                    request = AsyncRequestBuilder.get(uri);

View on GitHub (pinned to d6d39ce1c6)