cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache CXF Documentation > JAX-RS Deployment
Date Thu, 05 Jan 2012 13:28:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/2042/9/1/_/styles/combined.css?spaceKey=CXF20DOC&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://cwiki.apache.org/confluence/display/CXF20DOC/JAX-RS+Deployment">JAX-RS
Deployment</a></h2>
    <h4>Page  <b>added</b> by             <a href="https://cwiki.apache.org/confluence/display/~sergey_beryozkin">Sergey
Beryozkin</a>
    </h4>
         <br/>
    <div class="notificationGreySide">
         <p><span style="font-size:2em;font-weight:bold"> JAX-RS : Deployment
</span></p>

<div>
<ul>
    <li><a href='#JAX-RSDeployment-ApplicationServers'>Application Servers</a></li>
<ul>
    <li><a href='#JAX-RSDeployment-Glassfish'>Glassfish</a></li>
    <li><a href='#JAX-RSDeployment-JBoss'>JBoss</a></li>
    <li><a href='#JAX-RSDeployment-WebLogic'>WebLogic</a></li>
<ul>
    <li><a href='#JAX-RSDeployment-SpecifyingaWebLogicspecificJSPservlet'>Specifying
a WebLogic specific JSP servlet</a></li>
    <li><a href='#JAX-RSDeployment-SelectingWoodstoxasthedefaultparser'>Selecting
Woodstox as the default parser</a></li>
</ul>
</ul>
</ul></div>

<p>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.  </p>

<h1><a name="JAX-RSDeployment-ApplicationServers"></a>Application Servers</h1>
<h2><a name="JAX-RSDeployment-Glassfish"></a>Glassfish</h2>

<p><b>Verified with Glassfish Server Open Source Edition 3.1.1</b></p>

<ul class="alternate" type="square">
	<li>Make sure a cxf-rt-transport-http-jetty dependency is excluded during the war build</li>
	<li>If a custom JAX-RS <a href="http://jsr311.java.net/nonav/releases/1.1/index.html"
class="external-link" rel="nofollow">Application</a> is included then<br/>
  use a <a href="CXFNonSpringJaxrsServlethttp://cxf.apache.org/docs/jaxrs-services-configuration.html#JAXRSServicesConfiguration-ConfiguringJAXRSservicesincontainerwithoutSpring"
class="external-link" rel="nofollow">CXFNonSpringJaxrsServlethttp://cxf.apache.org/docs/jaxrs-services-configuration.html#JAXRSServicesConfiguration-ConfiguringJAXRSservicesincontainerwithoutSpring</a>
to reference the Application implementation class and disable the Jersey scanning the custom
web applications (TODO: specify how this actually can be disabled)  </li>
</ul>


<h2><a name="JAX-RSDeployment-JBoss"></a>JBoss</h2>

<p><b>Verified with JBoss AS 7.1.0.CR1b</b></p>

<ul class="alternate" type="square">
	<li>If a custom JAX-RS <a href="http://jsr311.java.net/nonav/releases/1.1/index.html"
class="external-link" rel="nofollow">Application</a> is included then<br/>
  use a <a href="CXFNonSpringJaxrsServlethttp://cxf.apache.org/docs/jaxrs-services-configuration.html#JAXRSServicesConfiguration-ConfiguringJAXRSservicesincontainerwithoutSpring"
class="external-link" rel="nofollow">CXFNonSpringJaxrsServlethttp://cxf.apache.org/docs/jaxrs-services-configuration.html#JAXRSServicesConfiguration-ConfiguringJAXRSservicesincontainerwithoutSpring</a>
to reference the Application implementation class and disable the RestEasy scanning the custom
web applications (TODO: specify how this actually can be disabled).</li>
</ul>


<h2><a name="JAX-RSDeployment-WebLogic"></a>WebLogic</h2>

<p><b>Verified with WebLogic Server 12c (12.1.1)</b></p>

<h3><a name="JAX-RSDeployment-SpecifyingaWebLogicspecificJSPservlet"></a>Specifying
a WebLogic specific JSP servlet</h3>

<p>If you configure CXFServlet to redirect to custom JSP pages then you need to add
the following declaration to web.xml:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml">
<span class="code-tag">&lt;servlet&gt;</span>
 <span class="code-tag">&lt;servlet-name&gt;</span>jsp<span class="code-tag">&lt;/servlet-name&gt;</span>
 <span class="code-tag">&lt;servlet-class&gt;</span>weblogic.servlet.JSPServlet<span
class="code-tag">&lt;/servlet-class&gt;</span>
<span class="code-tag">&lt;/servlet&gt;</span> 
</pre>
</div></div>

<h3><a name="JAX-RSDeployment-SelectingWoodstoxasthedefaultparser"></a>Selecting
Woodstox as the default parser</h3>

<p>WebLogic requires the following update to the proprietary deployment descriptor weblogic.xml:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml">
  <span class="code-tag">&lt;container-descriptor&gt;</span>
   <span class="code-tag"><span class="code-comment">&lt;!-- SNIP --&gt;</span></span>
   <span class="code-tag">&lt;prefer-web-inf-classes&gt;</span>true<span
class="code-tag">&lt;/prefer-web-inf-classes&gt;</span>
  <span class="code-tag">&lt;/container-descriptor&gt;</span>
</pre>
</div></div>

<p>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.<br/>
Please see this <a href="https://forums.oracle.com/forums/message.jspa?messageID=9953045"
class="external-link" rel="nofollow">thread</a> for more information.</p>

    </div>
    <div id="commentsSection" class="wiki-content pageSection">
       <div style="float: right;">
            <a href="https://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
       </div>
       <a href="https://cwiki.apache.org/confluence/display/CXF20DOC/JAX-RS+Deployment">View
Online</a>
              |
       <a href="https://cwiki.apache.org/confluence/display/CXF20DOC/JAX-RS+Deployment?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
           </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message