{"record":{"id":"2817b63a8b3596b5","repo":"flowable/flowable-engine","slug":"several-jaxb-binding-definitions-found-for-flowabl-2817b6","errorCode":null,"errorMessage":"Several JAXB binding definitions found for flowable-cxf: \" + CxfWSDLImporter.JAXB_BINDINGS_RESOURCE","messagePattern":"Several JAXB binding definitions found for flowable-cxf: \" \\+ CxfWSDLImporter\\.JAXB_BINDINGS_RESOURCE","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cxf/src/main/java/org/flowable/engine/impl/webservice/CxfWebServiceClient.java","lineNumber":52,"sourceCode":" * \n * @author Esteban Robles Luna\n */\npublic class CxfWebServiceClient implements SyncWebServiceClient {\n\n    private static final Logger LOGGER = LoggerFactory.getLogger(CxfWebServiceClient.class);\n\n    protected Client client;\n\n    public CxfWebServiceClient(String wsdl) {\n        JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance();\n        Enumeration<URL> xjcBindingUrls;\n        try {\n            xjcBindingUrls = Thread.currentThread().getContextClassLoader()\n                    .getResources(CxfWSDLImporter.JAXB_BINDINGS_RESOURCE);\n            if (xjcBindingUrls.hasMoreElements()) {\n                final URL xjcBindingUrl = xjcBindingUrls.nextElement();\n                if (xjcBindingUrls.hasMoreElements()) {\n                    throw new FlowableException(\"Several JAXB binding definitions found for flowable-cxf: \"\n                            + CxfWSDLImporter.JAXB_BINDINGS_RESOURCE);\n                }\n                this.client = dcf.createClient(wsdl, Arrays.asList(new String[] { xjcBindingUrl.toString() }));\n                this.client.getRequestContext().put(\"org.apache.cxf.stax.force-start-document\", Boolean.TRUE);\n            } else {\n                throw new FlowableException(\"The JAXB binding definitions are not found for flowable-cxf: \"\n                        + CxfWSDLImporter.JAXB_BINDINGS_RESOURCE);\n            }\n        } catch (IOException e) {\n            throw new FlowableException(\"An error occurs creating a web-service client for WSDL '\" + wsdl + \"'.\", e);\n        }\n    }\n\n    @Override\n    public Object[] send(String methodName, Object[] arguments, ConcurrentMap<QName, URL> overridenEndpointAddresses) throws Exception {\n        try {\n            URL newEndpointAddress = null;\n            if (overridenEndpointAddresses != null) {","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cxf/src/main/java/org/flowable/engine/impl/webservice/CxfWebServiceClient.java#L34-L70","documentation":"The CxfWebServiceClient constructor locates the JAXB bindings resource (CxfWSDLImporter.JAXB_BINDINGS_RESOURCE) on the classpath. If more than one resource with that name is found, the classpath is ambiguous, so construction fails fast. The library expects exactly zero-or-one (and treats zero as a separate error).","triggerScenarios":"Constructing new CxfWebServiceClient(wsdl) when two or more JAXB_BINDINGS_RESOURCE files exist on the classpath.","commonSituations":"Multiple jars on the classpath each bundling the same bindings resource, fat/uber jars merging resources, or duplicate module dependencies in a Flowable app.","solutions":["Inspect the classpath (e.g. ClassLoader.getResources on the resource name) and remove the duplicate jar/module containing the extra bindings file.","If building a fat jar, exclude duplicate copies of the resource via shading exclusions.","Ensure only the flowable-cxf module's own bindings resource is packaged."],"exampleFix":"// before: both flowable-cxf and a copied legacy ode jar on classpath\nclasspath: flowable-cxf.jar, ode-old.jar (contains same bindings resource)\n// after: remove ode-old.jar or exclude the resource\n<exclusion><groupId>org.apache.ode</groupId><artifactId>ode-old</artifactId></exclusion>","handlingStrategy":"validation","validationCode":"Enumeration<URL> urls = Thread.currentThread().getContextClassLoader()\n    .getResources(\"org/flowable/cxf/bindings.xml\"); // CxfWSDLImporter.JAXB_BINDINGS_RESOURCE\nint count = 0;\nwhile (urls.hasMoreElements()) { urls.nextElement(); count++; }\nif (count > 1) throw new IllegalStateException(\"Duplicate JAXB bindings resources on classpath: \" + count);","typeGuard":null,"tryCatchPattern":"try { new CxfWebServiceClient(wsdl); } catch (FlowableException e) { if (e.getMessage().contains(\"Several JAXB binding definitions\")) { /* dedupe classpath */ } else { throw e; } }","preventionTips":["Run mvn dependency:tree to spot duplicate flowable-cxf/legacy jars","Configure shade plugin resource transformers/exclusions","Audit fat jars for duplicated XML resources"],"tags":["classpath","jaxb","duplicate-resource","cxf"],"backgroundTag":"conflicting-config-options","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"}