Use native Java SE 6 JAX-WS implementation instead of JBoss WS stack

Anthony Accioly picture Anthony Accioly · Mar 13, 2012 · Viewed 12.9k times · Source

JBoss 6.0 Final is shipped with JBoss WS (Apache CXF stack by default), I know that I can replace the default implementation with the respective JBoss WS Native or Metro versions from JBossWS downloads site.

The problem is, I've a client jar library (binaries only unfortunately) which consumes some proprietary SOAP Web Services. When I use the client API from a Web Application deployed to JBoss I'm getting a lot of intermittent SOAP Faults (tested with both Apache CXF and JBoss Native stacks).

Since the same Web Services seems to work fine when running from a standalone jar file (with no third party JAX-WS implementations), I was thinking about disabling the JBoss WS stack in favor of the native JAX-WS RI stack provided with Java SE 6.

I know that JBoss Metro WS stack should be close enough to what is shipped with Java SE 6, but I would really appreciate if I could go with the native Java SE version.

So, is this feasible? Can someone point the way?

Answer

Yves Martin picture Yves Martin · Mar 14, 2012

Here is a procedure to remove JBossWS-CXF client and server stack from JBoss 6.1.0.Final. Replace <configuration> by the server configuration you use, probably default.

  • Remove the following files and directory structure
common/deploy/jbossws-console.war
lib/endorsed/jbossws-cxf-factories.jar
server/<configuration>/deploy/jbossws-console-activator-jboss-beans.xml
server/<configuration>/deployers/jbossws.deployer/
server/<configuration>/deployers/jbossws-jaxrpc.deployer/
  • Edit and remove the two following parts from server/<configuration>/deployers/switchboard-jboss-beans.xml
<entry>
  <key>javax.xml.ws.WebServiceContext</key>
  <value><inject bean="org.jboss.switchboard.WebServiceContextResourceProvider"/></value>
</entry>
... and ...
<inject bean="org.jboss.switchboard.WebServiceRefResourceProvider"/>

As a result, the WebService server stack is no longer available, neither the jbossws console.

To be sure to use JAX-WS Metro implementation from your JavaSE version running JBoss, you have also to remove from Class-Path any jar related to CXF and JAX-WS:

lib/endorsed/jboss-jaxws-api_2.2_spec.jar
lib/endorsed/stax-api.jar
lib/endorsed/jboss-jaxb-api_2.2_spec.jar
common/lib/jboss-jaxb-api_2.2_spec.jar
common/lib/jboss-jaxws-api_2.2_spec.jar
common/lib/jboss-jaxrpc-api_1.1_spec.jar
common/lib/cxf-*.jar
lib/wstx-lgpl.jar
lib/jaxb-impl.jar
lib/jaxb-xjc.jar

At that point, JBoss 6.1 even starts faster.