flowable/flowable-engine · error · FlowableException
Several JAXB binding definitions found for flowable-cxf: "…
Error message
Several JAXB binding definitions found for flowable-cxf: " + CxfWSDLImporter.JAXB_BINDINGS_RESOURCE
What it means
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).
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.
Example fix
// before: both flowable-cxf and a copied legacy ode jar on classpath classpath: flowable-cxf.jar, ode-old.jar (contains same bindings resource) // after: remove ode-old.jar or exclude the resource <exclusion><groupId>org.apache.ode</groupId><artifactId>ode-old</artifactId></exclusion>
Defensive patterns
Strategy: validation
Validate before calling
Enumeration<URL> urls = Thread.currentThread().getContextClassLoader()
.getResources("org/flowable/cxf/bindings.xml"); // CxfWSDLImporter.JAXB_BINDINGS_RESOURCE
int count = 0;
while (urls.hasMoreElements()) { urls.nextElement(); count++; }
if (count > 1) throw new IllegalStateException("Duplicate JAXB bindings resources on classpath: " + count); Try / catch
try { new CxfWebServiceClient(wsdl); } catch (FlowableException e) { if (e.getMessage().contains("Several JAXB binding definitions")) { /* dedupe classpath */ } else { throw e; } } Prevention
- Run mvn dependency:tree to spot duplicate flowable-cxf/legacy jars
- Configure shade plugin resource transformers/exclusions
- Audit fat jars for duplicated XML resources
When it happens
Trigger: Constructing new CxfWebServiceClient(wsdl) when two or more JAXB_BINDINGS_RESOURCE files exist on the classpath.
Common situations: Multiple jars on the classpath each bundling the same bindings resource, fat/uber jars merging resources, or duplicate module dependencies in a Flowable app.
Understand the failure class
Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.
Related errors
- Several JAXB binding definitions found for flowable-cxf: "…
- Error retrieving the JAXB binding definitions
- The JAXB binding definitions are not found for…
- The JAXB binding definitions are not found for…
- An error occurs creating a web-service client for WSDL '" +…
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/2817b63a8b3596b5.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable-cxf/src/main/java/org/flowable/engine/impl/webservice/CxfWebServiceClient.java:52
*
* @author Esteban Robles Luna
*/
public class CxfWebServiceClient implements SyncWebServiceClient {
private static final Logger LOGGER = LoggerFactory.getLogger(CxfWebServiceClient.class);
protected Client client;
public CxfWebServiceClient(String wsdl) {
JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance();
Enumeration<URL> xjcBindingUrls;
try {
xjcBindingUrls = Thread.currentThread().getContextClassLoader()
.getResources(CxfWSDLImporter.JAXB_BINDINGS_RESOURCE);
if (xjcBindingUrls.hasMoreElements()) {
final URL xjcBindingUrl = xjcBindingUrls.nextElement();
if (xjcBindingUrls.hasMoreElements()) {
throw new FlowableException("Several JAXB binding definitions found for flowable-cxf: "
+ CxfWSDLImporter.JAXB_BINDINGS_RESOURCE);
}
this.client = dcf.createClient(wsdl, Arrays.asList(new String[] { xjcBindingUrl.toString() }));
this.client.getRequestContext().put("org.apache.cxf.stax.force-start-document", Boolean.TRUE);
} else {
throw new FlowableException("The JAXB binding definitions are not found for flowable-cxf: "
+ CxfWSDLImporter.JAXB_BINDINGS_RESOURCE);
}
} catch (IOException e) {
throw new FlowableException("An error occurs creating a web-service client for WSDL '" + wsdl + "'.", e);
}
}
@Override
public Object[] send(String methodName, Object[] arguments, ConcurrentMap<QName, URL> overridenEndpointAddresses) throws Exception {
try {
URL newEndpointAddress = null;
if (overridenEndpointAddresses != null) {View on GitHub (pinned to d6d39ce1c6)