{"record":{"id":"6675761088f83a72","repo":"flowable/flowable-engine","slug":"problem-retrieving-flowable-context-xml-resources","errorCode":null,"errorMessage":"problem retrieving flowable-context.xml resources on the classpath: ${System.getProperty(\"java.class.path\")}","messagePattern":"problem retrieving flowable-context\\.xml resources on the classpath: (.+?)","errorType":"exception","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/ProcessEngines.java","lineNumber":98,"sourceCode":"                throw new FlowableIllegalArgumentException(\"problem retrieving flowable.cfg.xml resources on the classpath: \" + System.getProperty(\"java.class.path\"), e);\n            }\n\n            // Remove duplicated configuration URL's using set. Some\n            // classloaders may return identical URL's twice, causing duplicate\n            // startups\n            Set<URL> configUrls = new HashSet<>();\n            while (resources.hasMoreElements()) {\n                configUrls.add(resources.nextElement());\n            }\n            for (URL resource : configUrls) {\n                LOGGER.info(\"Initializing process engine using configuration '{}'\", resource);\n                initProcessEngineFromResource(resource);\n            }\n\n            try {\n                resources = classLoader.getResources(\"flowable-context.xml\");\n            } catch (IOException e) {\n                throw new FlowableIllegalArgumentException(\"problem retrieving flowable-context.xml resources on the classpath: \" + System.getProperty(\"java.class.path\"), e);\n            }\n            while (resources.hasMoreElements()) {\n                URL resource = resources.nextElement();\n                LOGGER.info(\"Initializing process engine using Spring configuration '{}'\", resource);\n                initProcessEngineFromSpringResource(resource);\n            }\n\n            setInitialized(true);\n        } else {\n            LOGGER.info(\"Process engines already initialized\");\n        }\n    }\n\n    protected static void initProcessEngineFromSpringResource(URL resource) {\n        try {\n            Class<?> springConfigurationHelperClass = ReflectUtil.loadClass(\"org.flowable.spring.SpringConfigurationHelper\");\n            Method method = springConfigurationHelperClass.getDeclaredMethod(\"buildProcessEngine\", new Class<?>[] { URL.class });\n            ProcessEngine processEngine = (ProcessEngine) method.invoke(null, new Object[] { resource });","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/ProcessEngines.java#L80-L116","documentation":"Same lookup mechanism as the flowable.cfg.xml case, but for flowable-context.xml (Spring-based engine configuration) resources. An IOException from ClassLoader.getResources during ProcessEngines.init() is wrapped in FlowableIllegalArgumentException including java.class.path.","triggerScenarios":"ProcessEngines.init() / getProcessEngine() invoked when ClassLoader.getResources(\"flowable-context.xml\") throws IOException due to a broken classloader or damaged classpath resource.","commonSituations":"Spring deployments that place flowable-context.xml in jars; hot redeployment leaving closed classloaders; corrupted application jars in a servlet container's webapps directory.","solutions":["Check the cause IOException to identify the failing jar/resource and repair or remove it","Restart the application server or perform a clean redeploy to get a healthy classloader","Validate all jars on the classpath (e.g. unzip -t) and rebuild corrupted artifacts"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"Enumeration<URL> res = ReflectUtil.getClassLoader().getResources(\"flowable-context.xml\");\nif (!res.hasMoreElements()) { /* no spring config expected; skip auto-init */ }","typeGuard":null,"tryCatchPattern":"try {\n    engine = ProcessEngines.getDefaultProcessEngine();\n} catch (FlowableIllegalArgumentException e) {\n    // check cause IOException, fix broken jar/classloader, restart, retry\n}","preventionTips":["Perform clean redeploys instead of hot-swapping jars containing flowable-context.xml","Periodically verify container webapps dirs for truncated/corrupt jars"],"tags":["flowable","classpath","spring","classloader"],"backgroundTag":"file-read-failed","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"}