flowable/flowable-engine · warning
Invalid Message conversion exception. Error ID
Error message
Invalid Message conversion exception. Error ID: {}. Message: {}, Request: {} {} What it means
handleBadMessageConversion in BaseExceptionHandlerAdvice logs this warning and returns a generic 'Bad request' ErrorInfo when an HttpMessageConversionException occurs handling a REST request. In non-debug mode the client only receives an anonymous 'Invalid HTTP message. Error ID: <uuid>' so the real cause stays server-side for correlation via the logged Error ID.
Solutions
- Validate the request body is well-formed JSON matching the endpoint's expected DTO.
- Set the correct Content-Type header (application/json) and matching HTTP method.
- Check server logs for the logged Error ID to find the underlying conversion message.
- If a serializer upgrade caused it, align client field names/date formats with the server's Jackson configuration.
Example fix
// before
curl -X POST http://host/flowable-rest/tasks -d '{bad json' -H 'Content-Type: text/plain'
// after
curl -X POST http://host/flowable-rest/tasks -d '{"name":"My task"}' -H 'Content-Type: application/json' Defensive patterns
Strategy: try-catch
Validate before calling
// client-side pre-validation
JSON.parse(requestBody); // must not throw
if (!requestBody.trim().startsWith("{")) throw new Error("Body must be a JSON object"); Type guard
function isJsonObject(body) { try { return typeof JSON.parse(body) === "object"; } catch { return false; } } Try / catch
try { const res = await fetch(url, { headers: { "Content-Type": "application/json" }, body }); } catch (e) { console.error("Bad request payload", e); } Prevention
- Always send Content-Type: application/json with JSON bodies.
- Validate payloads against the REST API's DTO schema before sending.
- Correlate returned Error IDs with server logs when debugging.
When it happens
Trigger: A REST client sends a request body that cannot be converted to the endpoint's expected type — malformed JSON, wrong Content-Type, or a payload violating Jackson binding — and the exception is not an HttpMediaTypeNotSupportedException subclass.
Common situations: Sending invalid JSON to REST API endpoints (e.g. Flowable REST task/process APIs); missing or wrong Content-Type header; payload using unsupported field types or date formats.
Understand the failure class
Background: "Invalid JSON response" and "Failed to parse response" errors: when an API answers 200 but the body isn't the JSON your library expected — this error's family across 28 libraries.
Related errors
- A request body was expected when bulk updating tasks.
- A request body was expected when executing a task action.
- A request body was expected when updating the task.
- baseUrl can not be null
- Cannot get variable value for jackson 2
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/831ce489c0ccd03b.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable-common-rest/src/main/java/org/flowable/common/rest/exception/BaseExceptionHandlerAdvice.java:121
public ErrorInfo handleIllegalState(FlowableIllegalStateException e, HttpServletRequest request) {
if (logger.isDebugEnabled()) {
logger.debug("Illegal state. Message: {}, Request: {} {}", e.getMessage(), request.getMethod(), request.getRequestURI());
}
return new ErrorInfo("Bad request", e);
}
@ResponseStatus(HttpStatus.BAD_REQUEST) // 400
@ExceptionHandler(HttpMessageConversionException.class)
@ResponseBody
public ErrorInfo handleBadMessageConversion(HttpMessageConversionException e, HttpServletRequest request) {
if (sendFullErrorException) {
if (logger.isDebugEnabled()) {
logger.debug("Invalid message conversion. Message: {}, Request: {} {}", e.getMessage(), request.getMethod(), request.getRequestURI());
}
return new ErrorInfo("Bad request", e);
} else {
String errorIdentifier = UUID.randomUUID().toString();
logger.warn("Invalid Message conversion exception. Error ID: {}. Message: {}, Request: {} {}", errorIdentifier, e.getMessage(), request.getMethod(), request.getRequestURI());
ErrorInfo errorInfo = new ErrorInfo("Bad request", null);
errorInfo.setException("Invalid HTTP message. Error ID: " + errorIdentifier);
return errorInfo;
}
}
@ResponseStatus(HttpStatus.CONFLICT) // 409
@ExceptionHandler(FlowableTaskAlreadyClaimedException.class)
@ResponseBody
public ErrorInfo handleTaskAlreadyClaimed(FlowableTaskAlreadyClaimedException e, HttpServletRequest request) {
if (logger.isDebugEnabled()) {
logger.debug("Task was already claimed. Message: {}, Request: {} {}", e.getMessage(), request.getMethod(), request.getRequestURI());
}
return new ErrorInfo("Task was already claimed", e);
}
// Fall back
View on GitHub (pinned to d6d39ce1c6)