JAX-RS : Deployment
This page provides the tips on how to deploy CXF JAX-RS applications packaged as WAR archives or OSGI bundles into Java EE application servers and OSGI containers.
Application Servers
Glassfish
Verified with Glassfish Server Open Source Edition 3.1.1
- Make sure a cxf-rt-transport-http-jetty dependency is excluded during the war build
- If a custom JAX-RS Application
is included then
use a CXFNonSpringJaxrsServletto reference the Application implementation class and disable the Jersey scanning the custom web applications (TODO: specify how this actually can be disabled)
JBoss
Verified with JBoss AS 7.1.0.CR1b
- If a custom JAX-RS Application
is included then
use a CXFNonSpringJaxrsServletto reference the Application implementation class and disable the RestEasy scanning the custom web applications (TODO: specify how this actually can be disabled).
WebLogic
Verified with WebLogic Server 12c (12.1.1)
Specifying a WebLogic specific JSP servlet
If you configure CXFServlet to redirect to custom JSP pages then you need to add the following declaration to web.xml:
<servlet> <servlet-name>jsp</servlet-name> <servlet-class>weblogic.servlet.JSPServlet</servlet-class> </servlet>
Selecting Woodstox as the default parser
WebLogic requires the following update to the proprietary deployment descriptor weblogic.xml:
<container-descriptor> <!-- SNIP --> <prefer-web-inf-classes>true</prefer-web-inf-classes> </container-descriptor>
This instructs WebLogic's classloaders to look FIRST in the JARS from the application's WEB-INF/lib directory for Service Provider Implementations (in this case, to find META-INF/services/javax.xml.stream.XMLInputFactory in the Woodstox JAR) rather than to the system classloader.
Please see this thread for more information.