flowable/flowable-engine · error · FlowableIllegalArgumentException
Deserialized value is not an array of ID's:
Error message
Deserialized value is not an array of ID's:
What it means
When reading a JPA entity list variable back, deserializeIds Java-deserializes the stored bytes and requires the result to be a String[]. If the deserialized object is anything else, FlowableIllegalArgumentException is thrown.
Solutions
- Inspect the stored BYTE value in the variable table and delete/repair the corrupted variable
- Re-set the variable with a valid list of JPA entities to rewrite correct bytes
- Check Flowable upgrade notes for variable serialization format changes and migrate data
- Ensure no other code writes to the same variable byte array
Example fix
// before // legacy variable row with non-String[] bytes SELECT BYTES_ FROM ACT_RU_VARIABLE WHERE NAME_='customers'; -- inspect // after runtimeService.setVariable(executionId, "customers", validEntityList); // rewrites bytes
Defensive patterns
Strategy: validation
Validate before calling
// inspect persisted bytes before reading the variable
byte[] bytes = readVariableBytesFromDb("customers");
boolean looksValid = bytes != null && bytes.length > 0; Try / catch
try { Object v = runtimeService.getVariable(executionId, "customers"); } catch (FlowableIllegalArgumentException e) { if (e.getMessage().startsWith("Deserialized value is not an array of ID's")) { runtimeService.setVariable(executionId, "customers", null); } else throw e; } Prevention
- Never hand-edit variable byte columns in the DB
- Review serialization-format changes when upgrading Flowable and migrate data
- Keep one value type per variable name — don't reuse a name across entity-list and scalar values
When it happens
Trigger: getValue → ids → deserializeIds encountering stored bytes that decode to a non-String[] object: bytes written by an older Flowable version with a different format, manual corruption, or bytes written for a different variable type.
Common situations: Upgrading Flowable where the persisted variable byte format changed; manually editing variable byte values in DB; reusing a variable name across incompatible value types.
Related errors
- Unexpected exception when deserializing JPA id's
- Cannot flush EntityManager, an active transaction is…
- Cannot set JPA variable:
- Could not deserialize event to json
- Could not deserialize event to xml
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/8b0b8608cb9e3b77.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable-variable-service/src/main/java/org/flowable/variable/service/impl/types/JPAEntityListVariableType.java:163
String[] toStore = ids.toArray(new String[] {});
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream out = new ObjectOutputStream(baos);
out.writeObject(toStore);
return baos.toByteArray();
} catch (IOException ioe) {
throw new FlowableException("Unexpected exception when serializing JPA id's", ioe);
}
}
protected String[] deserializeIds(byte[] bytes) {
try {
ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
ObjectInputStream in = new ObjectInputStream(bais);
Object read = in.readObject();
if (!(read instanceof String[])) {
throw new FlowableIllegalArgumentException("Deserialized value is not an array of ID's: " + read);
}
return (String[]) read;
} catch (IOException | ClassNotFoundException ioe) {
throw new FlowableException("Unexpected exception when deserializing JPA id's", ioe);
}
}
}
View on GitHub (pinned to d6d39ce1c6)