{"record":{"id":"b18092ce6a31e3dd","repo":"flowable/flowable-engine","slug":"cannot-initialize-byte-array-no-engine-configurat","errorCode":null,"errorMessage":"Cannot initialize byte array. No engine configuration found","messagePattern":"Cannot initialize byte array\\. No engine configuration found","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/persistence/entity/ByteArrayRef.java","lineNumber":218,"sourceCode":"                engineConfiguration = getFirstEngineConfigurationWithByteArrayEntityManager(commandContext);\n            }\n            \n            return engineConfiguration;\n        }\n    }\n\n    protected AbstractEngineConfiguration getEngineConfigurationForAllType(CommandContext commandContext) {\n        AbstractEngineConfiguration engineConfiguration = commandContext.getEngineConfigurations().get(ScopeTypes.BPMN);\n        if (engineConfiguration == null) {\n            engineConfiguration = commandContext.getEngineConfigurations().get(ScopeTypes.CMMN);\n            \n            if (engineConfiguration == null) {\n                engineConfiguration = getFirstEngineConfigurationWithByteArrayEntityManager(commandContext);\n            }\n        }\n        \n        if (engineConfiguration == null) {\n            throw new IllegalStateException(\"Cannot initialize byte array. No engine configuration found\");\n        }\n        \n        return engineConfiguration;\n    }\n    \n    protected AbstractEngineConfiguration getFirstEngineConfigurationWithByteArrayEntityManager(CommandContext commandContext) {\n        AbstractEngineConfiguration engineConfiguration = null;\n        for (AbstractEngineConfiguration possibleEngineConfiguration : commandContext.getEngineConfigurations().values()) {\n            if (possibleEngineConfiguration.getByteArrayEntityManager() != null) {\n                engineConfiguration = possibleEngineConfiguration;\n                break;\n            }\n        }\n        \n        if (engineConfiguration == null) {\n            throw new IllegalStateException(\"Cannot initialize byte array. No engine configuration found\");\n        }\n        ","sourceCodeStart":200,"sourceCodeEnd":236,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/persistence/entity/ByteArrayRef.java#L200-L236","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\n// only process engine started, but ref came from cmmn engine DB\nByteArrayRef ref = new ByteArrayRef(); ref.setId(idFromCmmnDb);\n// after\n// boot all engines sharing the DB before accessing refs, or resolve via the owning engine's services","handlingStrategy":"try-catch","validationCode":"boolean engineBooted = !ProcessEngines.getProcessEngines().isEmpty();\n// ensure the owning engine is registered before touching its byte arrays","typeGuard":null,"tryCatchPattern":"try {\n    ref.getBytes();\n} catch (IllegalStateException e) {\n    if (e.getMessage().endsWith(\"No engine configuration found\")) {\n        // boot the owning engine / fix database wiring\n    }\n    throw e;\n}","preventionTips":["Boot all engines sharing the same database together","Never share byte-array ids across engine installations","Verify engineConfiguration lookups in multi-engine setups"],"tags":["byte-array","engine-configuration","lookup"],"backgroundTag":"engine-configuration-not-found","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}