Wildfly Swarm and cxf-rt-transports-http

638 views Asked by At

I'm trying to convert my project from EAP 6.3 to Wildfly Swarm...

I'm having some trouble with CXF.

I've got the fraction dependency:

<dependency>
  <groupId>org.wildfly.swarm</groupId>
  <artifactId>camel-cxf</artifactId>
</dependency>

And then later, I include this, because otherwise I get a "package org.apache.cxf.message does not exist" error in my Camel Processor code

    <dependency>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-rt-transports-http</artifactId>
        <version>3.1.9</version>
    </dependency>

So if I include it, I get the error:

Apache CXF library (cxf-core-3.1.9.jar) detected in ws endpoint deployment; either provide a proper deployment replacing embedded libraries with container module dependencies or disable the webservices subsystem for the current deployment adding a proper jboss-deployment-structure.xml descriptor to it. The former approach is recommended, as the latter approach causes most of the webservices Java EE and any JBossWS specific functionality to be disabled.

Ok, so maybe there's a lib conflict between the camel-cxf modules and my jar... or it's not picking up my jboss-deployment-structure.xml file?

I've tried a few things as suggested by other posts.

I tried adding this to jboss-deployment-structure.xml under ${basedir}/src/main/webapp/WEB-INF and adding the xml file to the webResources of the maven-war-plugin.

  <deployment>
    <exclude-subsystems>
        <subsystem name="webservices" /> 
    </exclude-subsystems>  
  </deployment>

I've also tried adding this to jboss-deployment-structure.xml:

<dependencies>
    <module name="org.apache.cxf" />
    <module name="org.apache.cxf.impl" />
</dependencies>

But I keep getting that error. So I'm not sure how to resolve this conflict. Any idea?

1

There are 1 answers

3
ravthiru On

One Approach is to use Jboss provided CXF libraries and set <scope>provided</scope> for cxf-rt-transports-http, so that it compiles and but not package the CXF dependencies .

You find more on Jboss specific configuration