flowable/flowable-engine · error · FlowableContentNotSupportedException
The provided body contains a serialized object for which…
Error message
The provided body contains a serialized object for which the class was not found:
What it means
FlowableContentNotSupportedException thrown when deserializing the uploaded object fails with ClassNotFoundException in setBinaryVariable. The request body contained a Java-serialized object whose class is not on the Flowable server's classpath, so the server cannot reconstruct it. The missing class name is appended to the message.
Solutions
- Add the missing class (named in the message) to the Flowable server classpath
- Align package/class names between client and server deployments
- Prefer JSON variables over Java serialization for portability
- Include serialVersionUID-compatible class versions on both sides
Example fix
// before: uploading instance of com.myapp.CustomDto not present on server
// after: add myapp-dto jar to server libs, or send JSON:
PUT /cmmn-runtime/tasks/{id}/variables {"name":"v","type":"string","value":"..."} Defensive patterns
Strategy: try-catch
Validate before calling
const isSerializableClass = (cls) => /* verify class name matches a class deployed on the server */ deployedClassNames.has(cls.name);
Try / catch
try { await uploadSerializable(obj) } catch (e) { if (e.message.includes('class was not found')) deployMissingClass(e.cause) ?? useJsonInstead(obj); } Prevention
- Prefer JSON over Java serialization for REST variables
- Keep client and server classpaths in sync (same jars/versions)
- Pin serialVersionUID and avoid renaming serialized classes
When it happens
Trigger: Uploading type='serializable' content whose serialized stream references a class absent from the server's classpath — the ClassNotFoundException message names the missing class.
Common situations: Deploying a custom class version that was later renamed/refactored; server missing the client application's domain classes; different package names between client and server builds; running on Flowable server without the app's dependency jars.
Related errors
- Couldn't deserialize object in variable ''
- The provided body contains a serialized object for which…
- The provided body contains a serialized object for which…
- The provided body contains a serialized object for which…
- An error occurs converting output value as JSon
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/d042851fdc14d6cf.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/task/TaskVariableBaseResource.java:199
setVariable(task, variableName, variableBytes, scope, isNew);
} else if (isSerializableVariableAllowed) {
// Try deserializing the object
ObjectInputStream stream = new ObjectInputStream(file.getInputStream());
Object value = stream.readObject();
setVariable(task, variableName, value, scope, isNew);
stream.close();
} else {
throw new FlowableContentNotSupportedException("Serialized objects are not allowed");
}
return getVariableFromRequestWithoutAccessCheck(task, variableName, scope, false);
} catch (IOException ioe) {
throw new FlowableIllegalArgumentException("Error getting binary variable", ioe);
} catch (ClassNotFoundException ioe) {
throw new FlowableContentNotSupportedException("The provided body contains a serialized object for which the class was not found: " + ioe.getMessage());
}
}
protected RestVariable setSimpleVariable(RestVariable restVariable, Task task, boolean isNew) {
if (restVariable.getName() == null) {
throw new FlowableIllegalArgumentException("Variable name is required");
}
// Figure out scope, revert to local is omitted
RestVariableScope scope = restVariable.getVariableScope();
if (scope == null) {
scope = RestVariableScope.LOCAL;
}
Object actualVariableValue = restResponseFactory.getVariableValue(restVariable);
setVariable(task, restVariable.getName(), actualVariableValue, scope, isNew);
View on GitHub (pinned to d6d39ce1c6)