JBossWS - AS 7 FAQ
This page is about the JBossWS integration with JBoss Application Server 7, which comes with a completely new architecture based on modules.
Since 4.0.0
Which modules belong to JBossWS? Am I supposed to modify them?
The org.jboss.as.webservices.* and org.jboss.ws.* modules belongs to the JBossWS - AS7 integration. Users should not need to change anything in them.
I'm getting a ClassNotFoundException with an application that used to work on AS6, what's happening?
On JBoss AS7 the user deployment classloader does not have any visibility over JBoss internals; so for instance you can't directly use JBossWS implementation classes unless you explicitly set a dependency to the corresponding module.
How do I add dependencies to modules on my deployments?
Dependencies are configured in the deployment MANIFEST.MF file:
Manifest-Version: 1.0
Dependencies: org.jboss.ws.cxf.jbossws-cxf-client services export, foo.bar
Here above org.jboss.ws.cxf.jbossws-cxf-client and foo.bar are the module you want to set dependencies to; services tells the modules framework that you want to also import META-INF/services/.. declarations from the dependency, while export exports the classes in the module so that you can actually use them in your code.
How can I use JAXB classes?
In order for successfully use JAXB contexts, etc. in your client or endpoint running in-container, you need to properly setup a JAXB implementation; that is performed setting the following dependency:
Dependencies: com.sun.xml.bind services export
How can I use JBossWS APIs?
The JBossWS APIs are always available by default whenever the webservices subsystem is available on AS7. So you just use them.
How can I use Apache CXF APIs?
In order for using Apache CXF APIs you need to add a dependency to the org.apache.cxf module:
Dependencies: org.apache.cxf
...however, please note that would not come with any JBossWS-CXF customizations nor additional extensions. See next FAQ.
Is there an aggregation client side module with all WS dependencies?
Yes. Whenever you simply want to use all the JBossWS feature/functionalities, you can set a dependency to the convenient client module. For the JBossWS-CXF stack that's:
Dependencies: org.jboss.ws.cxf.jbossws-cxf-client services export
Please note the services option above: that's strictly required in order for you to get the JBossWS-CXF version of classes that are retrieved using the Service API, the Bus for instance. Issues due because of misconfiguration here can be quite hard to track down, because the Apache CXF behaviour would be sensibly different.
What is the org.jboss.ws.jaxws-client module for?
That is the generic JAXWS client module that is internally loaded when the first call to the configured JAXWS Provider is performed. Depending on the configured ws stack, that pulls in the required modules for basic jaxws functionalities.
How do I use Spring with JBossWS-CXF?
The JBossWS-CXF modules have optional dependencies to the org.springframework.spring module. So either create that manually in the application server or use the JBossWS-CXF installation scripts for doing that.
What SAAJ impl do I get doing MessageFactory.getFactory()?
...
My annotations are being ignored (and I get no special warning about that)!
When using annotations on your endpoints / handlers such as the Apache CXF ones (@InInterceptor, @GZIP, ...), or JBossWS Native ones (@EndpointConfig, @Documentation, ...) remember to add the proper module dependency in your manifest. Otherwise your annotations are not picked up and added to the annotation index by JBoss AS7, resulting in them being completely ignored (even silently in many cases -this needs to be fixed-).