Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

 

 

 

 

 

{span:style=
Span
Wiki Markup
style
font-size:2em;font-weight:bold
} JAX-RS : Deployment {span}Deployment
 

 

 

 

 

Table of Contents

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.

Spring Boot

Please see CXF SpringBoot documenation. 

Please see JAX-RS Spring Boot and JAX-RS Spring Boot Scan demos.

Servlet Containers

Tomcat

1. System "org.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH"
and "org.apache.catalina.connector.CoyoteAdapter.ALLOW_BACKSLASH" properties may have to be set to "true" to support URIs containing encoded forward or backward slashes.
2. When using mod_jk - ensure that the JkOptions setting has +ForwardURICompatUnparsed set.
3. Windows: upgrade isapi_redirect.dll if you see URI containing encoded spaces being decoded by Tomcat.

...

If you configure CXFServlet to redirect to custom JSP pages then you need to add the following declaration to web.xml:

Code Block
xml
xml

<servlet>
 <servlet-name>jsp</servlet-name>
 <servlet-class>weblogic.servlet.JSPServlet</servlet-class>
</servlet> 

...

WebLogic requires the following update to the proprietary deployment descriptor weblogic.xml:

Code Block
xml
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.

Downgrading Servlet version

It was reported that downgrading a web-app descriptor version in web.xml can help disable the native (Jersey) scanning:

Code Block
xml
xml
  <!-- From: -->
  <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
    http://java.sun.com/xml/ns/j2ee/web-app_3_0.xsd">
  </web-app>
  <!-- To: -->
  <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
    http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
  </web-app>

Removing myfaces-shared-impl jar

It was reported if myfaces-shared-impl-4.1.0.jar is shipped in a web application lib folder then removing it helps, with the following descriptor being effective:

Code Block
xml
xml
<weblogic-web-app>
  <context-root>/emessaging</context-root>
  <container-descriptor>
    <prefer-web-inf-classes>false</prefer-web-inf-classes>
	<prefer-application-packages>
		<package-name>javax.faces.*</package-name>
	</prefer-application-packages>	
  </container-descriptor>

</weblogic-web-app>

 

 

 

How to use CXF JAX-RS 2.0 if WebLogic ships JAX-RS 1.1

Please see the following email message.

Geronimo

CXF RuntimeDelegate

...