{"record":{"id":"35f6a44931a82a5a","repo":"flowable/flowable-engine","slug":"expecting-a-springprocessengineconfiguration-for-t","errorCode":null,"errorMessage":"Expecting a SpringProcessEngineConfiguration for the Camel module.","messagePattern":"Expecting a SpringProcessEngineConfiguration for the Camel module\\.","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-camel/src/main/java/org/flowable/camel/SpringCamelBehavior.java","lineNumber":85,"sourceCode":"            return (CamelContext) compatibilityHandler.getCamelContextObject(camelContextValue);\n\n        } else {\n            // Convert it to a SpringProcessEngineConfiguration. If this doesn't work, throw a RuntimeException.\n            try {\n                SpringProcessEngineConfiguration springConfiguration = (SpringProcessEngineConfiguration) engineConfiguration;\n                if (StringUtils.isEmpty(camelContextValue)) {\n                    camelContextValue = springConfiguration.getDefaultCamelContext();\n                }\n\n                // Get the CamelContext object and set the super's member variable.\n                Object ctx = springConfiguration.getApplicationContext().getBean(camelContextValue);\n                if (!(ctx instanceof SpringCamelContext)) {\n                    throw new FlowableException(\"Could not find CamelContext named \" + camelContextValue + \".\");\n                }\n                return (SpringCamelContext) ctx;\n\n            } catch (Exception e) {\n                throw new FlowableException(\"Expecting a SpringProcessEngineConfiguration for the Camel module.\", e);\n            }\n        }\n    }\n\n    \n}\n","sourceCodeStart":67,"sourceCodeEnd":92,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-camel/src/main/java/org/flowable/camel/SpringCamelBehavior.java#L67-L92","documentation":"SpringCamelBehavior.resolveCamelContext requires the process engine configuration to be a SpringProcessEngineConfiguration so it can access the Spring ApplicationContext and resolve the CamelContext bean. Flowable throws this FlowableException when the configuration is of another type (or the lookup otherwise fails), wrapped as cause when an exception occurs during resolution.","triggerScenarios":"Running the flowable-camel module with a standalone (non-Spring) ProcessEngineConfiguration, e.g. ProcessEngineConfigurationImpl built programmatically or via default engine bootstrap, while camel behavior tries to resolve a Spring-managed CamelContext.","commonSituations":"Bootstrapping the engine outside of Spring (tests, plain Java main) but using the Spring camel behavior; engine built by a non-Spring activiti/flowable configuration class; migrating from Spring setup to standalone without switching camel context resolution.","solutions":["Use SpringProcessEngineConfiguration to build the process engine when integrating with the flowable-camel module.","If running standalone, register the CamelContext directly on the camel behavior instead of relying on Spring lookup (or use the non-Spring CamelBehavior).","Verify the engine initialization path: in Spring, declare the engine via processEngineConfiguration bean so the Spring config type is used.","Inspect the wrapped cause exception in the FlowableException for the underlying lookup failure."],"exampleFix":"// before\nProcessEngineConfiguration cfg = ProcessEngineConfiguration.createStandaloneProcessEngineConfiguration();\n// after\nSpringProcessEngineConfiguration cfg = new SpringProcessEngineConfiguration();\ncfg.setApplicationContext(applicationContext);","handlingStrategy":"validation","validationCode":"if (!(processEngineConfiguration instanceof SpringProcessEngineConfiguration)) {\n    throw new IllegalStateException(\"flowable-camel requires SpringProcessEngineConfiguration\");\n}","typeGuard":"if (cfg instanceof org.flowable.engine.spring.SpringProcessEngineConfiguration springCfg) { /* Spring lookup available */ }","tryCatchPattern":"try {\n    return springCamelBehavior.getCamelContext();\n} catch (FlowableException e) {\n    if (e.getMessage().contains(\"Expecting a SpringProcessEngineConfiguration\")) {\n        // rebuild engine with SpringProcessEngineConfiguration\n    }\n    throw e;\n}","preventionTips":["Build the engine via SpringProcessEngineConfiguration whenever using flowable-camel.","Avoid standalone engine configurations with the Spring camel behavior.","Check the wrapped cause for the real lookup failure."],"tags":["camel","flowable","spring","engine-configuration"],"backgroundTag":"config-type-mismatch","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}