flowable/flowable-engine · error · FlowableException

Several JAXB binding definitions found for flowable-cxf: "…

Error message

Several JAXB binding definitions found for flowable-cxf: " + JAXB_BINDINGS_RESOURCE

What it means

When building a CXF dynamic client, the importer locates a JAXB binding customization file (JAXB_BINDINGS_RESOURCE) on the context classpath. If more than one resource exists under that name, the generated classes would be ambiguous, so it throws FlowableException 'Several JAXB binding definitions found for flowable-cxf'.

Solutions

  1. Find the duplicate jars with ClassLoader.getResources (print the enumeration) and remove/shade-exclude the extra copy.
  2. Ensure only one flowable-cxf version is on the classpath (mvn dependency:tree / gradle dependencies).
  3. Rename or relocate your own binding files so they don't collide with the flowable-cxf resource name.

Example fix

<!-- before -->
<dependency>org.flowable:flowable-cxf:6.7.2</dependency>
<dependency>org.flowable:flowable-cxf:5.23.0</dependency>
<!-- after: keep a single version -->
<dependency>org.flowable:flowable-cxf:6.7.2</dependency>
Defensive patterns

Strategy: validation

Validate before calling

Enumeration<URL> urls = Thread.currentThread().getContextClassLoader().getResources("jaxb-bindings.xml");
List<URL> list = new ArrayList<>();
while (urls.hasMoreElements()) list.add(urls.nextElement());
if (list.size() > 1) throw new IllegalStateException("Duplicate JAXB binding resources: " + list);

Try / catch

try {
    importer.importFrom(wsdlUrl);
} catch (FlowableException e) {
    if (e.getMessage().contains("Several JAXB binding definitions")) {
        // inspect classpath for duplicate jars
    }
}

Prevention

When it happens

Trigger: Two or more JAXB binding files with the same classpath name (e.g. bundled by different jars or duplicated in the app's resources) present when Thread.currentThread().getContextClassLoader().getResources(...) returns multiple URLs during importFrom.

Common situations: Shading/uber-jars duplicating the binding resource; multiple flowable-cxf versions on the classpath; application code accidentally shipping a file at the same resource path; fat-jar build including resources twice.

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


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/ade8a2d58b79de26. Report an issue: GitHub.

Appendix: source

Thrown at modules/flowable-cxf/src/main/java/org/flowable/engine/impl/webservice/CxfWSDLImporter.java:121

    protected URIResolver createUriResolver(String sourceSystemId, Import theImport) throws IOException {
        return new URIResolver(sourceSystemId, theImport.getLocation());
    }

    public void importFrom(String url) {
        this.wsServices.clear();
        this.wsOperations.clear();
        this.structures.clear();

        this.wsdlLocation = url;

        try {
            Bus bus = BusFactory.getDefaultBus();
            final Enumeration<URL> xjcBindingUrls = Thread.currentThread().getContextClassLoader().getResources(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: " + JAXB_BINDINGS_RESOURCE);
                }
                DynamicClientFactory.newInstance(bus).createClient(url, Arrays.asList(new String[] { xjcBindingUrl.toString() }));
                WSDLManager wsdlManager = bus.getExtension(WSDLManager.class);
                Definition def = wsdlManager.getDefinition(url);
                WSDLServiceBuilder builder = new WSDLServiceBuilder(bus);
                List<ServiceInfo> services = builder.buildServices(def);

                for (ServiceInfo service : services) {
                    WSService wsService = this.importService(service);
                    this.wsServices.put(this.namespace + wsService.getName(), wsService);
                }

                if (def != null && def.getTypes() != null) {
                    this.importTypes(def.getTypes());
                }
            } else {
                throw new FlowableException("The JAXB binding definitions are not found for flowable-cxf: " + JAXB_BINDINGS_RESOURCE);
            }

View on GitHub (pinned to d6d39ce1c6)