flowable/flowable-engine · error · IllegalStateException
Cannot initialize byte array. No engine configuration found
Error message
Cannot initialize byte array. No engine configuration found
What it means
getEngineConfigurationForAllType looks up an AbstractEngineConfiguration from the current context (trying engine-type and scope-type mappings, then any configuration with a byte array entity manager). If no engine configuration can be found at all, it throws IllegalStateException, meaning the byte array cannot be initialized because no booted engine owns it.
Solutions
- Ensure the engine that created the byte array is booted in the current process and shares the same database
- Verify Context command-context engine configurations include one with a byte array entity manager
- Do not reuse byte array ids across engines/databases
Example fix
// before // only process engine started, but ref came from cmmn engine DB ByteArrayRef ref = new ByteArrayRef(); ref.setId(idFromCmmnDb); // after // boot all engines sharing the DB before accessing refs, or resolve via the owning engine's services
Defensive patterns
Strategy: try-catch
Validate before calling
boolean engineBooted = !ProcessEngines.getProcessEngines().isEmpty(); // ensure the owning engine is registered before touching its byte arrays
Try / catch
try {
ref.getBytes();
} catch (IllegalStateException e) {
if (e.getMessage().endsWith("No engine configuration found")) {
// boot the owning engine / fix database wiring
}
throw e;
} Prevention
- Boot all engines sharing the same database together
- Never share byte-array ids across engine installations
- Verify engineConfiguration lookups in multi-engine setups
When it happens
Trigger: Accessing a ByteArrayRef whose id belongs to an engine that is not registered/started in the current JVM or context (e.g. id from another engine's database), outside any known engine configuration.
Common situations: Copying byte array rows between different engine databases; referencing old byte-array ids after re-deploying only some engines; running in a context where multiple engines exist but none has a byte array entity manager configured.
Related errors
- Cannot find process definition with id
- Cannot find process definition with id
- Cannot initialize byte array. There is no command context…
- Cannot set JPA variable
- CmmnEngineConfiguration is required
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/b18092ce6a31e3dd.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/persistence/entity/ByteArrayRef.java:218
engineConfiguration = getFirstEngineConfigurationWithByteArrayEntityManager(commandContext);
}
return engineConfiguration;
}
}
protected AbstractEngineConfiguration getEngineConfigurationForAllType(CommandContext commandContext) {
AbstractEngineConfiguration engineConfiguration = commandContext.getEngineConfigurations().get(ScopeTypes.BPMN);
if (engineConfiguration == null) {
engineConfiguration = commandContext.getEngineConfigurations().get(ScopeTypes.CMMN);
if (engineConfiguration == null) {
engineConfiguration = getFirstEngineConfigurationWithByteArrayEntityManager(commandContext);
}
}
if (engineConfiguration == null) {
throw new IllegalStateException("Cannot initialize byte array. No engine configuration found");
}
return engineConfiguration;
}
protected AbstractEngineConfiguration getFirstEngineConfigurationWithByteArrayEntityManager(CommandContext commandContext) {
AbstractEngineConfiguration engineConfiguration = null;
for (AbstractEngineConfiguration possibleEngineConfiguration : commandContext.getEngineConfigurations().values()) {
if (possibleEngineConfiguration.getByteArrayEntityManager() != null) {
engineConfiguration = possibleEngineConfiguration;
break;
}
}
if (engineConfiguration == null) {
throw new IllegalStateException("Cannot initialize byte array. No engine configuration found");
}
View on GitHub (pinned to d6d39ce1c6)