Author: buildbot
Date: Thu Jun 9 14:47:39 2016
New Revision: 990257
Log:
Production update by buildbot for cxf
Added:
websites/production/cxf/content/docs/springboot.html
Modified:
websites/production/cxf/content/cache/docs.pageCache
websites/production/cxf/content/docs/application-server-specific-configuration-guide.html
websites/production/cxf/content/docs/jax-rs-deployment.html
websites/production/cxf/content/docs/jaxrs-services-configuration.html
Modified: websites/production/cxf/content/cache/docs.pageCache
==============================================================================
Binary files - no diff available.
Modified:
websites/production/cxf/content/docs/application-server-specific-configuration-guide.html
==============================================================================
---
websites/production/cxf/content/docs/application-server-specific-configuration-guide.html
(original)
+++
websites/production/cxf/content/docs/application-server-specific-configuration-guide.html
Thu Jun 9 14:47:39 2016
@@ -117,14 +117,13 @@ Apache CXF -- Application Server Specifi
<td height="100%">
<!-- Content -->
<div class="wiki-content">
-<div id="ConfluenceContent"><p>This document provides app server-specific
configuration information for running Apache CXF.</p>
-<style type="text/css">/*<![CDATA[*/
-div.rbtoc1435780139893 {padding: 0px;}
-div.rbtoc1435780139893 ul {list-style: disc;margin-left: 0px;padding-left:
20px;}
-div.rbtoc1435780139893 li {margin-left: 0px;padding-left: 0px;}
+<div id="ConfluenceContent"><p>This document provides app server-specific
configuration information for running Apache CXF.</p><p><style
type="text/css">/*<![CDATA[*/
+div.rbtoc1465483619018 {padding: 0px;}
+div.rbtoc1465483619018 ul {list-style: disc;margin-left: 0px;padding-left:
20px;}
+div.rbtoc1465483619018 li {margin-left: 0px;padding-left: 0px;}
-/*]]>*/</style><div class="toc-macro rbtoc1435780139893">
-<ul class="toc-indentation"><li><a shape="rect"
href="#ApplicationServerSpecificConfigurationGuide-JBossApplicationServer">JBoss
Application Server</a></li><li><a shape="rect"
href="#ApplicationServerSpecificConfigurationGuide-WebLogic">WebLogic</a>
+/*]]>*/</style></p><div class="toc-macro rbtoc1465483619018">
+<ul class="toc-indentation"><li><a shape="rect"
href="#ApplicationServerSpecificConfigurationGuide-JBossApplicationServer">JBoss
Application Server</a></li><li><a shape="rect"
href="#ApplicationServerSpecificConfigurationGuide-SpringBoot">SpringBoot</a></li><li><a
shape="rect"
href="#ApplicationServerSpecificConfigurationGuide-WebLogic">WebLogic</a>
<ul class="toc-indentation"><li><a shape="rect"
href="#ApplicationServerSpecificConfigurationGuide-Putjarsinendorsedfolder">Put
jars in endorsed folder</a></li><li><a shape="rect"
href="#ApplicationServerSpecificConfigurationGuide-Packwarinanear,deploytheearwithweblogic-application.xml">Pack
war in an ear, deploy the ear with weblogic-application.xml</a></li></ul>
</li><li><a shape="rect"
href="#ApplicationServerSpecificConfigurationGuide-Websphere">Websphere</a>
<ul class="toc-indentation"><li><a shape="rect"
href="#ApplicationServerSpecificConfigurationGuide-ForWebSphereVersions<6.1.0.29">For
WebSphere Versions < 6.1.0.29</a>
@@ -139,18 +138,8 @@ div.rbtoc1435780139893 li {margin-left:
</li></ul>
</li></ul>
</li><li><a shape="rect"
href="#ApplicationServerSpecificConfigurationGuide-IntegrationwithApplicationServerFAQ">Integration
with Application Server FAQ</a></li><li><a shape="rect"
href="#ApplicationServerSpecificConfigurationGuide-Resources">Resources</a></li></ul>
-</div>
-
-<h2
id="ApplicationServerSpecificConfigurationGuide-JBossApplicationServer">JBoss
Application Server</h2>
-
-<p>JBoss Application Server (JBoss AS) comes with its own webservices stack
(JBossWS) in order for providing full JavaEE support.<br clear="none">
-Starting from JBoss AS 6 M4, the default webservices stack is internally based
on Apache CXF; as a consequence users might experiment classloading issues with
classes from both the CXF libraries and its dependencies if included in
deployments and not properly isolated. Please refer to the relevant JBoss AS
documentation for details on how to turn on classloading isolation on the
application server version in use.</p>
-
-<p>In particular, when willing to run Apache CXF based applications on top of
JBoss AS 7 series, users have basically two options:</p>
-<ul><li>use JBoss AS as if it was a servlet container with no WS
functionalities: this basically implies disabling the webservices subsystem for
the user deployment, hence preventing the AS webservices stack from processing
the ws endpoint deployment and letting the CXF libs included in the archive
deal with any WS invocations when CXFServlet is hit; the webservices subsystem
is turned off by adding a jboss-deployment-structure.xml as follows to the ws
endpoint deployment:
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
-<pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;">
-<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
+</div><h2
id="ApplicationServerSpecificConfigurationGuide-JBossApplicationServer">JBoss
Application Server</h2><p>JBoss Application Server (JBoss AS) comes with its
own webservices stack (JBossWS) in order for providing full JavaEE support.<br
clear="none"> Starting from JBoss AS 6 M4, the default webservices stack is
internally based on Apache CXF; as a consequence users might experiment
classloading issues with classes from both the CXF libraries and its
dependencies if included in deployments and not properly isolated. Please refer
to the relevant JBoss AS documentation for details on how to turn on
classloading isolation on the application server version in use.</p><p>In
particular, when willing to run Apache CXF based applications on top of JBoss
AS 7 series, users have basically two options:</p><ul><li><p>use JBoss AS as if
it was a servlet container with no WS functionalities: this basically implies
disabling the webservices subsystem for the user deployment, hence preventing
the AS webservices stack from processing the ws endpoint deployment and
letting the CXF libs included in the archive deal with any WS invocations when
CXFServlet is hit; the webservices subsystem is turned off by adding a
jboss-deployment-structure.xml as follows to the ws endpoint
deployment:</p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
+<pre class="brush: xml; gutter: false; theme: Default"
style="font-size:12px;"><jboss-deployment-structure
xmlns="urn:jboss:deployment-structure:1.2">
<deployment>
<exclude-subsystems>
<subsystem name="webservices" />
@@ -158,31 +147,8 @@ Starting from JBoss AS 6 M4, the default
</deployment>
</jboss-deployment-structure>
</pre>
-</div></div>
-this approach offers the fastest route to deploying CXF apps on JBoss AS; the
drawback is that no special ws integration with JBoss AS internals is
available</li></ul>
-
-
-<ul><li>rely on JBossWS integration and the Apache CXF libraries included in
the application server (<a shape="rect" class="external-link"
href="https://docs.jboss.org/author/display/AS71/Webservices+reference+guide"
rel="nofollow">documentation</a>): this implies removing any Apache CXF libs
from the ws deployment as well as any other dependencies which is already
included in JBoss AS (including any Java EE API jar); if included, the optional
web.xml descriptor is to be rewritten according to JBossWS convention (see <a
shape="rect" class="external-link"
href="https://docs.jboss.org/author/display/AS71/JAX-WS+User+Guide"
rel="nofollow">documentation</a>); the Spring support is optional in JBoss AS
and Spring based endpoint declaration is not the default/preferred
configuration approach for ws endpoints, hence users willing to declare
endpoints using Spring needs to create a org.springframework.spring module and
put their endpoint declarations in a jbossws-cxf.xml descriptor; if the
user application makes use of any lib besides tha JavaEE api, proper module <a
shape="rect" class="external-link"
href="https://docs.jboss.org/author/display/AS71/Class+Loading+in+AS7"
rel="nofollow">dependencies</a> are to be declared either using the
jboss-deployment-structure.xml descriptor or the archive MANIFEST.MF (few
directions on ws modules available <a shape="rect" class="external-link"
href="https://docs.jboss.org/author/display/AS71/JBoss+Modules+and+WS+applications"
rel="nofollow">here</a>)</li></ul>
-
-
-<p>The second approach allows leveraging the full JavaEE 6 stack (including
e.g. JSR-109) as well as specific ws integration with JBoss AS internals.</p>
-
-<h2 id="ApplicationServerSpecificConfigurationGuide-WebLogic">WebLogic</h2>
-
-<p>There are two ways to deploy a CXF WAR archive in WebLogic. (<strong>Note:
This has been validated on WebLogic9.2.</strong>)</p>
-
-<h4
id="ApplicationServerSpecificConfigurationGuide-Putjarsinendorsedfolder">Put
jars in endorsed folder</h4>
-
-<ul><li>Put the geronimo-ws-metadata_2.0_spec-1.1.1.jar in the
$Weblogic_Home/jdk_../jre/lib/endorsed folder.</li><li>Deploy the CXF war in
weblogic.<br clear="none">
-(This way is not recommended, since it might break the application server
itself. The method below is preferred, as it impacts a single module
only.)</li></ul>
-
-
-<h4
id="ApplicationServerSpecificConfigurationGuide-Packwarinanear,deploytheearwithweblogic-application.xml">Pack
war in an ear, deploy the ear with weblogic-application.xml</h4>
-
-<ul><li>Create a standard J2EE application.xml file in the META-INF folder.
(Take $CXF_HOME/samples/java_first_spring_support for example)
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
-<pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;">
-<?xml version="1.0" encoding="UTF-8"?>
+</div></div><p>this approach offers the fastest route to deploying CXF apps on
JBoss AS; the drawback is that no special ws integration with JBoss AS
internals is available</p></li></ul><ul><li>rely on JBossWS integration and the
Apache CXF libraries included in the application server (<a shape="rect"
class="external-link"
href="https://docs.jboss.org/author/display/AS71/Webservices+reference+guide"
rel="nofollow">documentation</a>): this implies removing any Apache CXF libs
from the ws deployment as well as any other dependencies which is already
included in JBoss AS (including any Java EE API jar); if included, the optional
web.xml descriptor is to be rewritten according to JBossWS convention (see <a
shape="rect" class="external-link"
href="https://docs.jboss.org/author/display/AS71/JAX-WS+User+Guide"
rel="nofollow">documentation</a>); the Spring support is optional in JBoss AS
and Spring based endpoint declaration is not the default/preferred
configuration approach for ws endpoin
ts, hence users willing to declare endpoints using Spring needs to create a
org.springframework.spring module and put their endpoint declarations in a
jbossws-cxf.xml descriptor; if the user application makes use of any lib
besides tha JavaEE api, proper module <a shape="rect" class="external-link"
href="https://docs.jboss.org/author/display/AS71/Class+Loading+in+AS7"
rel="nofollow">dependencies</a> are to be declared either using the
jboss-deployment-structure.xml descriptor or the archive MANIFEST.MF (few
directions on ws modules available <a shape="rect" class="external-link"
href="https://docs.jboss.org/author/display/AS71/JBoss+Modules+and+WS+applications"
rel="nofollow">here</a>)</li></ul><p>The second approach allows leveraging the
full JavaEE 6 stack (including e.g. JSR-109) as well as specific ws integration
with JBoss AS internals.</p><h2
id="ApplicationServerSpecificConfigurationGuide-SpringBoot">SpringBoot</h2><p>Please
see CXF <a shape="rect" href="springboot.html">Spri
ngBoot</a> documenation.</p><h2
id="ApplicationServerSpecificConfigurationGuide-WebLogic">WebLogic</h2><p>There
are two ways to deploy a CXF WAR archive in WebLogic. (<strong>Note: This has
been validated on WebLogic9.2.</strong>)</p><h4
id="ApplicationServerSpecificConfigurationGuide-Putjarsinendorsedfolder">Put
jars in endorsed folder</h4><ul><li>Put the
geronimo-ws-metadata_2.0_spec-1.1.1.jar in the
$Weblogic_Home/jdk_../jre/lib/endorsed folder.</li><li>Deploy the CXF war in
weblogic.<br clear="none"> (This way is not recommended, since it might break
the application server itself. The method below is preferred, as it impacts a
single module only.)</li></ul><h4
id="ApplicationServerSpecificConfigurationGuide-Packwarinanear,deploytheearwithweblogic-application.xml">Pack
war in an ear, deploy the ear with
weblogic-application.xml</h4><ul><li><p>Create a standard J2EE application.xml
file in the META-INF folder. (Take $CXF_HOME/samples/java_first_spring_support
for example)</p><div
class="code panel pdl" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
+<pre class="brush: xml; gutter: false; theme: Default"
style="font-size:12px;"><?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE application PUBLIC
"-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN"
"http://java.sun.com/dtd/application_1_3.dtd">
@@ -196,13 +162,8 @@ this approach offers the fastest route t
</module>
</application>
</pre>
-</div></div></li></ul>
-
-
-<ul><li>Create a weblogic-application.xml (Weblogic specific) in the META-INF
folder.
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
-<pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;">
-<?xml version="1.0" encoding="UTF-8"?>
+</div></div></li></ul><ul><li><p>Create a weblogic-application.xml (Weblogic
specific) in the META-INF folder.</p><div class="code panel pdl"
style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<pre class="brush: xml; gutter: false; theme: Default"
style="font-size:12px;"><?xml version="1.0" encoding="UTF-8"?>
<weblogic-application xmlns="http://www.bea.com/ns/weblogic/90">
<application-param>
<param-name>webapp.encoding.default</param-name>
@@ -213,87 +174,8 @@ this approach offers the fastest route t
</prefer-application-packages>
</weblogic-application>
</pre>
-</div></div></li></ul>
-
-
-<p>The prefer-application-packages element you see above sets up WebLogic's <a
shape="rect" class="external-link"
href="http://e-docs.bea.com/wls/docs100/programming/classloading.html#wp1097187"
rel="nofollow">Filtering Classloader</a>. Each class whose package matches
one of the package-name elements listed will be searched for first within the
EAR before relying on the WebLogic system classloader's version. If a package
for a particular class is not listed here, WebLogic will try to load its own
(possibly older) version first, so if you are getting deployment errors due to
any particular class you might wish to add its package here.</p>
-
-<p>Also note you can, and may need to, specify other options in the
weblogic-application.xml file such as XML processing factories as shown <a
shape="rect" class="external-link"
href="http://cxf.547215.n5.nabble.com/Getting-error-while-deploying-on-weblogic-9-2-but-able-to-do-in-tomcat-td554060.html#a554061"
rel="nofollow">here</a>. See the WebLogic <a shape="rect"
class="external-link"
href="http://download.oracle.com/docs/cd/E12840_01/wls/docs103/programming/app_xml.html#wp1064995"
rel="nofollow">guide</a> for more information.</p>
-
-<ul><li>Run "jar cvf ..." command to create the ear and then deploy it.
Alternatively, this <a shape="rect" class="external-link"
href="http://www.jroller.com/gmazza/entry/deploying_webservices_on_weblogic"
rel="nofollow">blog entry</a> provides a Mavenized method of building the
EAR.</li></ul>
-
-
-<h2 id="ApplicationServerSpecificConfigurationGuide-Websphere">Websphere</h2>
-
-<h3
id="ApplicationServerSpecificConfigurationGuide-ForWebSphereVersions<6.1.0.29">For
WebSphere Versions < 6.1.0.29</h3>
-
-<p>Adding jars to the 'endorsed' folder appears to be the main solution:</p>
-
-<h4
id="ApplicationServerSpecificConfigurationGuide-NoWebServicesFeaturePackforWebSphereinstalled">No
Web Services Feature Pack for WebSphere installed</h4>
-
-
-<h5
id="ApplicationServerSpecificConfigurationGuide-putjarintheendorsedfolder">put
jar in the endorsed folder</h5>
-
-<ul><li>put the wsdl4j-1.6.1.jar in the $WebSphere_HOME/java/jre/lib/endorsed
folder.</li><li>In the WebSphere console, find the specific enterprise
application, click the "Class loading and update detection".
- <ul><li>Mark the "Classes loaded with application class loader first"
selected.</li><li>Mark the "Class loader for each war file in application"
selected.</li></ul>
- </li></ul>
-
-
-<p>And then restart the Websphere server. (Because we changed the endorsed
folder, we need to restart it to make it take effect).</p>
-<div class="confluence-information-macro
confluence-information-macro-tip"><span class="aui-icon aui-icon-small
aui-iconfont-approve confluence-information-macro-icon"></span><div
class="confluence-information-macro-body">
-<p>Please make sure your classpath doesn't have the servlet-2.5 library, since
WebSphere6.1 is servlet-2.4 compliant!</p></div></div>
-
-<h5 id="ApplicationServerSpecificConfigurationGuide-Addyourownclassloader">Add
your own class loader</h5>
-
-<p>If you put your wsdl4j-1.6.1 jar in $WAS_HOME/java/jre/lib/endorsed, all
your applications will depend on your version of wsdl4j. Another solution is to
create a new class loader in your server which loads before parent class
loader, create a shared library with your version of wsdl4j, and add this
shared library to your new class loader. This version of wsdl4j will only be
available for your specific server and not affect applications running in other
servers.</p>
-
-<p><strong>Step by step</strong></p>
-<ol><li>In the WAS console navigate to <strong>Environment > Shared
Libraries</strong></li><li>Select the scope you wish your library should be
visible in</li><li>Click <strong>New</strong> and set values ex:
<code>name=MYAPP_SHARED_LIB, classpath=PATH_TO/wsdl4j-1.6.2.jar</code> and
<strong>Save</strong></li><li>Navigate to <strong>Application servers >
[your server name]</strong> <strong>> Java and Process Management > Class
loader > New</strong></li><li>Select <strong>Classes loaded with application
class loader first</strong> and <strong>Save</strong></li><li>Select your new
class loader and click <strong>Shared library references</strong></li><li>Add
your shared library (MYAPP_SHARED_LIB) <strong>Save</strong> and restart your
server.
-<br clear="none" class="atl-forced-newline"></li></ol>
-
-
-<p>Tested in WAS 6.1 only but should work in earlier versions as well.</p>
-
-<p>Another user running WS6.1 FP 23 without the web services feature pack came
up with this solution that seemed to work for them:</p>
-<blockquote>
-<p>Create a shared library with the following jars:<br clear="none">
-jsr173_api-1.0.jar<br clear="none">
-jaxp-ri-1.4.2.jar<br clear="none">
-saaj-impl-1.3.2.jar<br clear="none">
-wsdl4j-1.6.2.jar</p>
-
-<p>Create a new parent-first classloader and have it reference the shared
library you just created. Restart everything and it should
work.</p></blockquote>
-
-<h4
id="ApplicationServerSpecificConfigurationGuide-WebServicesFeaturePackforWebSphereInstalled">Web
Services Feature Pack for WebSphere Installed</h4>
-
-<p>Things are way more complicated if the Web Services Feature Pack for
WebSphere is installed. With this feature pack installed, it is impossible to
deploy an application using CXF, because the WebSphere Web Services engine
starts parsing the JAX-WS annotations of the services and tries to deploy the
services.</p>
-
-<p>Up to fixpack 27 (6.1.0.27) there was no possibility to disable the
WebSphere Web Services engine.</p>
-
-<h3
id="ApplicationServerSpecificConfigurationGuide-ForWebSphere6.1.0.29+,V7andV8">For
WebSphere 6.1.0.29+, V7 and V8</h3>
-
-<p>Follow the PDF download given within this IBM developerWorks article:<a
shape="rect" class="external-link"
href="http://www.ibm.com/developerworks/websphere/library/techarticles/1001_thaker/1001_thaker.html"
rel="nofollow">http://www.ibm.com/developerworks/websphere/library/techarticles/1001_thaker/1001_thaker.html</a></p>
-
-<p>As described in the PDF, you'll need to change the Classloader order to
"Classes loaded with local class loader first (parent last)" and to disable the
IBM web services engine, either for the JVM as a whole or for the particular
module.</p>
-
-<p>To disable for the whole JVM, set the JVM property</p>
-
-<p>com.ibm.websphere.webservices.DisableIBMJAXWSEngine=true</p>
-
-<p>or to disable the engine just for a specific module by adding</p>
-
-<p>DisableIBMJAXWSEngine: true</p>
-
-<p>to WAR/META-INF/MANIFEST.MF.</p>
-
-
-<p>Another issue that comes up with certain versions of WebSphere is an
incompatibility with the SAAJ implementation. It is recommended to use the
org.apache.servicemix.bundles.saaj-impl-1.3.18_1.jar saaj impl available from
<a shape="rect" class="external-link"
href="http://repo1.maven.org/maven2/org/apache/servicemix/bundles/org.apache.servicemix.bundles.saaj-impl/1.3.18_1/"
rel="nofollow">http://repo1.maven.org/maven2/org/apache/servicemix/bundles/org.apache.servicemix.bundles.saaj-impl/1.3.18_1/</a>
as that contains a recent version of SAAJ along with it's required DOM
implementation which will work on the IBM JDK.</p>
-
-<p>One user has reported that he was able to get CXF working on WebSphere with
a minimal set of CXF jars by following the above<br clear="none">
-procedures and using the list of jars:</p>
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;">
-FastInfoset-1.2.9.jar
+</div></div></li></ul><p>The prefer-application-packages element you see above
sets up WebLogic's <a shape="rect" class="external-link"
href="http://e-docs.bea.com/wls/docs100/programming/classloading.html#wp1097187"
rel="nofollow">Filtering Classloader</a>. Each class whose package matches one
of the package-name elements listed will be searched for first within the EAR
before relying on the WebLogic system classloader's version. If a package for a
particular class is not listed here, WebLogic will try to load its own
(possibly older) version first, so if you are getting deployment errors due to
any particular class you might wish to add its package here.</p><p>Also note
you can, and may need to, specify other options in the weblogic-application.xml
file such as XML processing factories as shown <a shape="rect"
class="external-link"
href="http://cxf.547215.n5.nabble.com/Getting-error-while-deploying-on-weblogic-9-2-but-able-to-do-in-tomcat-td554060.html#a554061"
rel="nofollow">here
</a>. See the WebLogic <a shape="rect" class="external-link"
href="http://download.oracle.com/docs/cd/E12840_01/wls/docs103/programming/app_xml.html#wp1064995"
rel="nofollow">guide</a> for more information.</p><ul><li>Run "jar cvf ..."
command to create the ear and then deploy it. Alternatively, this <a
shape="rect" class="external-link"
href="http://www.jroller.com/gmazza/entry/deploying_webservices_on_weblogic"
rel="nofollow">blog entry</a> provides a Mavenized method of building the
EAR.</li></ul><h2
id="ApplicationServerSpecificConfigurationGuide-Websphere">Websphere</h2><h3
id="ApplicationServerSpecificConfigurationGuide-ForWebSphereVersions<6.1.0.29">For
WebSphere Versions < 6.1.0.29</h3><p>Adding jars to the 'endorsed' folder
appears to be the main solution:</p><h4
id="ApplicationServerSpecificConfigurationGuide-NoWebServicesFeaturePackforWebSphereinstalled">No
Web Services Feature Pack for WebSphere installed</h4><h5
id="ApplicationServerSpecificConfigurationGuide-putj
arintheendorsedfolder">put jar in the endorsed folder</h5><ul><li>put the
wsdl4j-1.6.1.jar in the $WebSphere_HOME/java/jre/lib/endorsed
folder.</li><li>In the WebSphere console, find the specific enterprise
application, click the "Class loading and update detection".<ul><li>Mark the
"Classes loaded with application class loader first" selected.</li><li>Mark the
"Class loader for each war file in application"
selected.</li></ul></li></ul><p>And then restart the Websphere server. (Because
we changed the endorsed folder, we need to restart it to make it take
effect).</p><div class="confluence-information-macro
confluence-information-macro-tip"><span class="aui-icon aui-icon-small
aui-iconfont-approve confluence-information-macro-icon"></span><div
class="confluence-information-macro-body"><p>Please make sure your classpath
doesn't have the servlet-2.5 library, since WebSphere6.1 is servlet-2.4
compliant!</p></div></div><h5
id="ApplicationServerSpecificConfigurationGuide-Addyourownclassl
oader">Add your own class loader</h5><p>If you put your wsdl4j-1.6.1 jar in
$WAS_HOME/java/jre/lib/endorsed, all your applications will depend on your
version of wsdl4j. Another solution is to create a new class loader in your
server which loads before parent class loader, create a shared library with
your version of wsdl4j, and add this shared library to your new class loader.
This version of wsdl4j will only be available for your specific server and not
affect applications running in other servers.</p><p><strong>Step by
step</strong></p><ol><li>In the WAS console navigate to <strong>Environment
> Shared Libraries</strong></li><li>Select the scope you wish your library
should be visible in</li><li>Click <strong>New</strong> and set values ex:
<code>name=MYAPP_SHARED_LIB, classpath=PATH_TO/wsdl4j-1.6.2.jar</code> and
<strong>Save</strong></li><li>Navigate to <strong>Application servers >
[your server name]</strong> <strong>> Java and Process Management > Class
loader >
; New</strong></li><li>Select <strong>Classes loaded with application class
loader first</strong> and <strong>Save</strong></li><li>Select your new class
loader and click <strong>Shared library references</strong></li><li>Add your
shared library (MYAPP_SHARED_LIB) <strong>Save</strong> and restart your
server.</li></ol><p>Tested in WAS 6.1 only but should work in earlier versions
as well.</p><p>Another user running WS6.1 FP 23 without the web services
feature pack came up with this solution that seemed to work for
them:</p><blockquote><p>Create a shared library with the following jars:<br
clear="none"> jsr173_api-1.0.jar<br clear="none"> jaxp-ri-1.4.2.jar<br
clear="none"> saaj-impl-1.3.2.jar<br clear="none">
wsdl4j-1.6.2.jar</p><p>Create a new parent-first classloader and have it
reference the shared library you just created. Restart everything and it should
work.</p></blockquote><h4
id="ApplicationServerSpecificConfigurationGuide-WebServicesFeaturePackforWebSphereInstalled">Web
Ser
vices Feature Pack for WebSphere Installed</h4><p>Things are way more
complicated if the Web Services Feature Pack for WebSphere is installed. With
this feature pack installed, it is impossible to deploy an application using
CXF, because the WebSphere Web Services engine starts parsing the JAX-WS
annotations of the services and tries to deploy the services.</p><p>Up to
fixpack 27 (6.1.0.27) there was no possibility to disable the WebSphere Web
Services engine.</p><h3
id="ApplicationServerSpecificConfigurationGuide-ForWebSphere6.1.0.29+,V7andV8">For
WebSphere 6.1.0.29+, V7 and V8</h3><p>Follow the PDF download given within
this IBM developerWorks article:<a shape="rect" class="external-link"
href="http://www.ibm.com/developerworks/websphere/library/techarticles/1001_thaker/1001_thaker.html"
rel="nofollow">http://www.ibm.com/developerworks/websphere/library/techarticles/1001_thaker/1001_thaker.html</a></p><p>As
described in the PDF, you'll need to change the Classloader order to "Clas
ses loaded with local class loader first (parent last)" and to disable the IBM
web services engine, either for the JVM as a whole or for the particular
module.</p><p>To disable for the whole JVM, set the JVM
property</p><p>com.ibm.websphere.webservices.DisableIBMJAXWSEngine=true</p><p>or
to disable the engine just for a specific module by
adding</p><p>DisableIBMJAXWSEngine: true</p><p>to
WAR/META-INF/MANIFEST.MF.</p><p>Another issue that comes up with certain
versions of WebSphere is an incompatibility with the SAAJ implementation. It is
recommended to use the org.apache.servicemix.bundles.saaj-impl-1.3.18_1.jar
saaj impl available from <a shape="rect" class="external-link"
href="http://repo1.maven.org/maven2/org/apache/servicemix/bundles/org.apache.servicemix.bundles.saaj-impl/1.3.18_1/"
rel="nofollow">http://repo1.maven.org/maven2/org/apache/servicemix/bundles/org.apache.servicemix.bundles.saaj-impl/1.3.18_1/</a>
as that contains a recent version of SAAJ along with it's required D
OM implementation which will work on the IBM JDK.</p><p>One user has reported
that he was able to get CXF working on WebSphere with a minimal set of CXF jars
by following the above<br clear="none"> procedures and using the list of
jars:</p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;">FastInfoset-1.2.9.jar
aopalliance-1.0.jar
commons-logging-1.1.1.jar
cxf-2.5.2.jar
@@ -320,15 +202,8 @@ woodstox-core-asl-4.1.1.jar
wsdl4j-1.6.2.jar
xmlschema-core-2.0.1.jar
</pre>
-</div></div>
-
-<h2 id="ApplicationServerSpecificConfigurationGuide-Glassfish">Glassfish</h2>
-
-<p>CXF Interceptors will not work in Glassfish without this sun-web.xml file
to configure the classloader. By default, Glassfish will use Metro for JAX-WS
services so the classloader needs to be configured to allow CXF libraries to
provide JAX-WS services. The following sun-web.xml xml source was added to
/WEB-INF to resolve this issue:</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
-<pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;">
-<?xml version="1.0" encoding="UTF-8"?>
+</div></div><h2
id="ApplicationServerSpecificConfigurationGuide-Glassfish">Glassfish</h2><p>CXF
Interceptors will not work in Glassfish without this sun-web.xml file to
configure the classloader. By default, Glassfish will use Metro for JAX-WS
services so the classloader needs to be configured to allow CXF libraries to
provide JAX-WS services. The following sun-web.xml xml source was added to
/WEB-INF to resolve this issue:</p><div class="code panel pdl"
style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<pre class="brush: xml; gutter: false; theme: Default"
style="font-size:12px;"><?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sun-web-app PUBLIC '-//Sun Microsystems, Inc.//DTD
Application Server 9.0 Servlet 2.5//EN'
'http://www.sun.com/software/appserver/dtds/sun-web-app_2_5-0.dtd'>
@@ -336,139 +211,18 @@ Application Server 9.0 Servlet 2.5//EN'
<class-loader delegate="false"/>
</sun-web-app>
</pre>
-</div></div>
-
-<h2 id="ApplicationServerSpecificConfigurationGuide-OC4J">OC4J</h2>
-
-<div class="confluence-information-macro
confluence-information-macro-note"><span class="aui-icon aui-icon-small
aui-iconfont-warning confluence-information-macro-icon"></span><div
class="confluence-information-macro-body">
-<p>This guide requires heavy customization of the OC4J configuration. Bear in
mind that some of steps presented below are either undocumented or unsupported.
We strongly advice you to perform those steps in a separate container,
dedicated exclusively for CXF.</p></div></div>
-
-<div class="confluence-information-macro
confluence-information-macro-note"><span class="aui-icon aui-icon-small
aui-iconfont-warning confluence-information-macro-icon"></span><div
class="confluence-information-macro-body">
-<p>Also see: <a shape="rect" class="external-link"
href="http://chadthedeveloper.blogspot.com/2008/06/cxf-vs-oc4j-round-1.html"
rel="nofollow">http://chadthedeveloper.blogspot.com/2008/06/cxf-vs-oc4j-round-1.html</a>
for other suggestions on how to configure OC4J.</p></div></div>
-
-<h3 id="ApplicationServerSpecificConfigurationGuide-Disclaimer">Disclaimer</h3>
-
-<p>This guide covers only 10.1.3.X.X version of OC4J. Note that OC4J 10.1.2 is
not JSE 1.5 certified server. OC4J 11_g_ is <a shape="rect"
class="external-link"
href="http://java.sun.com/javaee/overview/compatibility.jsp"
rel="nofollow">fully JEE 5.0 certified stack</a> and comes with their own
JAX-WS implementation.</p>
-
-<h3 id="ApplicationServerSpecificConfigurationGuide-Background">Background</h3>
-
-<p>Oracle OC4J comes with highly customized XML stack by Oracle including SAX,
StAX, JAXP, JAX-WS, SAAJ, WSDL and few others. All of those frameworks are
Oracle proprietary implementations in the OC4J distribution. This gives Oracle
really good interoperability between their products but it makes it rather hard
to introduce something which needs different implementation of above APIs (like
CXF).</p>
-<div class="confluence-information-macro
confluence-information-macro-tip"><span class="aui-icon aui-icon-small
aui-iconfont-approve confluence-information-macro-icon"></span><div
class="confluence-information-macro-body"><p><span
class="confluence-anchor-link"
id="ApplicationServerSpecificConfigurationGuide-orajaxws"></span><br
clear="none">
-OC4J 10.1.3 comes with <a shape="rect" class="external-link"
href="http://www.oracle.com/technology/tech/java/oc4j/10131/OracleAS-NF-10131.pdf"
rel="nofollow">preliminary implementation of JAX-WS (JSR-181)</a> but this
implementation is somewhat limited only to top-down scenario, with very limited
customization (lack of JAXB 2.0 etc.).</p></div></div>
-
-<h4
id="ApplicationServerSpecificConfigurationGuide-Configurationoverview">Configuration
overview</h4>
-
-<p>A few components need to be customized in OC4J to allow CFX integration:</p>
-<ul><li><a shape="rect" class="external-link"
href="http://xerces.apache.org/xerces2-j/">Xerces</a></li><li>JAX-WS 2.0
APIs</li><li><a shape="rect" class="external-link"
href="http://sourceforge.net/projects/wsdl4j"
rel="nofollow">WSDL4J</a></li></ul>
-
-
-<p>Unfortunately, these components have to be configured in different parts of
OC4J.</p>
-
-<h4
id="ApplicationServerSpecificConfigurationGuide-OracleOC4Jclassloading">Oracle
OC4J class loading</h4>
-
-<p>A key part of successfully integrating CXF into OC4J is to understand how
class loaders work in OC4J. When starting OC4J there are generally three stages
where customization could occur:</p>
-<ol><li>Virtual Machine boot</li><li>OC4J boot</li><li>CXF (application)
boot</li></ol>
-
-
-<p>Customizing in the last step is <a shape="rect" class="external-link"
href="http://download-uk.oracle.com/docs/cd/B25221_03/web.1013/b14433/classload.htm"
rel="nofollow">quite easy to achieve</a> - basically OC4J has quite powerful
class loader and an easy customization console. Unfortunately there are some
components that could not be configured this way. They are configured during
OC4J boot. Unfortunately one of this is OC4J webservices stack (located in
<code>$ORACLE_HOME/webservices/lib</code>).</p>
-
-<h4 id="ApplicationServerSpecificConfigurationGuide-Neededcomponents">Needed
components</h4>
-
-<p>Before start please download <a shape="rect"
href="http://cxf.apache.org/download.html">Apache CXF 2.0.6 or better</a> and
<a shape="rect" class="external-link"
href="http://archive.apache.org/dist/xml/xerces-j/">Xerces 2.8.1</a></p>
-
-<h4
id="ApplicationServerSpecificConfigurationGuide-Preparingstax-api">Preparing
stax-api</h4>
-
-<p>If you use a version of CXF that includes stax-api.jar that in turn include
the QName class, remove <code>javax.xml.namespace.QName</code> from the
stax-api shipped with CXF. Oracle apparently has it already in
<code>$ORACLE_HOME/j2ee/home/lib/jax-qname-namespace.jar</code>.</p>
-
-<p><span class="confluence-anchor-link"
id="ApplicationServerSpecificConfigurationGuide-xerces"></span></p>
-
-<h4
id="ApplicationServerSpecificConfigurationGuide-ReplacetheOracleXMLparserwithXerces">Replace
the Oracle XML parser with Xerces</h4>
-
-<p>The basic idea behind how to do this is described in detail <a shape="rect"
class="external-link"
href="http://www.oracle.com/technology/tech/java/oc4j/1013/how_to/how-to-swapxmlparser/doc/readme.html"
rel="nofollow">here</a></p>
-
-<p>Create OC4J shared library named <code>cxf.foundation</code> and fill it
with:</p>
-<ul><li>xercesImpl.jar (from Xerces distribution)</li><li>xml-apis-1.2.02.jar
(from CXF-distribution)</li><li>xalan-2.7.0.jar
(ditto)</li><li>geronimo-ws-metadata_2.0_spec-1.1.1.jar (ditto)
-<div class="confluence-information-macro
confluence-information-macro-note"><span class="aui-icon aui-icon-small
aui-iconfont-warning confluence-information-macro-icon"></span><div
class="confluence-information-macro-body">
-<p>When building Your application <strong>DO NOT INCLUDE THOSE
COMPONENTS</strong> again.</p></div></div></li></ul>
-
-
-<h4
id="ApplicationServerSpecificConfigurationGuide-GetridofOC4JJAX-WSlibraries">Get
rid of OC4J JAX-WS libraries</h4>
-
-<p>OC4J has <a shape="rect"
href="application-server-specific-configuration-guide.html">preliminary support
for JAX-WS</a>, unfortunately this means that during OC4J boot it loads
<em>outdated</em> JAX-WS APIs and implementation by Oracle. This occurs even
before shared libraries comes into action, at a very early stage of OC4J boot.
Boot-time OC4J libraries are configured in <code>boot.xml</code> file in
<code>$ORACLE_HOME/j2ee/home/oc4j.jar</code> bootstrap jar. To get rid of
this:</p>
-<ul><li>unpack <code>oc4j.jar</code> file</li><li>locate
<code>META-INF/boot.xml</code> file and edit it</li><li>find section</li></ul>
-
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
-<pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;">
-<!-- WS jax-rpc -->
+</div></div><h2
id="ApplicationServerSpecificConfigurationGuide-OC4J">OC4J</h2><div
class="confluence-information-macro confluence-information-macro-note"><span
class="aui-icon aui-icon-small aui-iconfont-warning
confluence-information-macro-icon"></span><div
class="confluence-information-macro-body"><p>This guide requires heavy
customization of the OC4J configuration. Bear in mind that some of steps
presented below are either undocumented or unsupported. We strongly advice you
to perform those steps in a separate container, dedicated exclusively for
CXF.</p></div></div><div class="confluence-information-macro
confluence-information-macro-note"><span class="aui-icon aui-icon-small
aui-iconfont-warning confluence-information-macro-icon"></span><div
class="confluence-information-macro-body"><p>Also see: <a shape="rect"
class="external-link"
href="http://chadthedeveloper.blogspot.com/2008/06/cxf-vs-oc4j-round-1.html"
rel="nofollow">http://chadthedeveloper.blogspot.com/2008/06/cxf-vs-oc
4j-round-1.html</a> for other suggestions on how to configure
OC4J.</p></div></div><h3
id="ApplicationServerSpecificConfigurationGuide-Disclaimer">Disclaimer</h3><p>This
guide covers only 10.1.3.X.X version of OC4J. Note that OC4J 10.1.2 is not JSE
1.5 certified server. OC4J 11_g_ is <a shape="rect" class="external-link"
href="http://java.sun.com/javaee/overview/compatibility.jsp"
rel="nofollow">fully JEE 5.0 certified stack</a> and comes with their own
JAX-WS implementation.</p><h3
id="ApplicationServerSpecificConfigurationGuide-Background">Background</h3><p>Oracle
OC4J comes with highly customized XML stack by Oracle including SAX, StAX,
JAXP, JAX-WS, SAAJ, WSDL and few others. All of those frameworks are Oracle
proprietary implementations in the OC4J distribution. This gives Oracle really
good interoperability between their products but it makes it rather hard to
introduce something which needs different implementation of above APIs (like
CXF).</p><div class="confluence-informati
on-macro confluence-information-macro-tip"><span class="aui-icon
aui-icon-small aui-iconfont-approve
confluence-information-macro-icon"></span><div
class="confluence-information-macro-body"><p><span
class="confluence-anchor-link"
id="ApplicationServerSpecificConfigurationGuide-orajaxws"></span><br
clear="none"> OC4J 10.1.3 comes with <a shape="rect" class="external-link"
href="http://www.oracle.com/technology/tech/java/oc4j/10131/OracleAS-NF-10131.pdf"
rel="nofollow">preliminary implementation of JAX-WS (JSR-181)</a> but this
implementation is somewhat limited only to top-down scenario, with very limited
customization (lack of JAXB 2.0 etc.).</p></div></div><h4
id="ApplicationServerSpecificConfigurationGuide-Configurationoverview">Configuration
overview</h4><p>A few components need to be customized in OC4J to allow CFX
integration:</p><ul><li><a shape="rect" class="external-link"
href="http://xerces.apache.org/xerces2-j/">Xerces</a></li><li>JAX-WS 2.0
APIs</li><li><a shape="rect" cl
ass="external-link" href="http://sourceforge.net/projects/wsdl4j"
rel="nofollow">WSDL4J</a></li></ul><p>Unfortunately, these components have to
be configured in different parts of OC4J.</p><h4
id="ApplicationServerSpecificConfigurationGuide-OracleOC4Jclassloading">Oracle
OC4J class loading</h4><p>A key part of successfully integrating CXF into OC4J
is to understand how class loaders work in OC4J. When starting OC4J there are
generally three stages where customization could occur:</p><ol><li>Virtual
Machine boot</li><li>OC4J boot</li><li>CXF (application)
boot</li></ol><p>Customizing in the last step is <a shape="rect"
class="external-link"
href="http://download-uk.oracle.com/docs/cd/B25221_03/web.1013/b14433/classload.htm"
rel="nofollow">quite easy to achieve</a> - basically OC4J has quite powerful
class loader and an easy customization console. Unfortunately there are some
components that could not be configured this way. They are configured during
OC4J boot. Unfortunately one of t
his is OC4J webservices stack (located in
<code>$ORACLE_HOME/webservices/lib</code>).</p><h4
id="ApplicationServerSpecificConfigurationGuide-Neededcomponents">Needed
components</h4><p>Before start please download <a shape="rect"
href="http://cxf.apache.org/download.html">Apache CXF 2.0.6 or better</a> and
<a shape="rect" class="external-link"
href="http://archive.apache.org/dist/xml/xerces-j/">Xerces 2.8.1</a></p><h4
id="ApplicationServerSpecificConfigurationGuide-Preparingstax-api">Preparing
stax-api</h4><p>If you use a version of CXF that includes stax-api.jar that in
turn include the QName class, remove <code>javax.xml.namespace.QName</code>
from the stax-api shipped with CXF. Oracle apparently has it already in
<code>$ORACLE_HOME/j2ee/home/lib/jax-qname-namespace.jar</code>.</p><p><span
class="confluence-anchor-link"
id="ApplicationServerSpecificConfigurationGuide-xerces"></span></p><h4
id="ApplicationServerSpecificConfigurationGuide-ReplacetheOracleXMLparserwithXerces">Replace
the Oracle XML parser with Xerces</h4><p>The basic idea behind how to do this
is described in detail <a shape="rect" class="external-link"
href="http://www.oracle.com/technology/tech/java/oc4j/1013/how_to/how-to-swapxmlparser/doc/readme.html"
rel="nofollow">here</a></p><p>Create OC4J shared library named
<code>cxf.foundation</code> and fill it with:</p><ul><li>xercesImpl.jar (from
Xerces distribution)</li><li>xml-apis-1.2.02.jar (from
CXF-distribution)</li><li>xalan-2.7.0.jar
(ditto)</li><li><p>geronimo-ws-metadata_2.0_spec-1.1.1.jar (ditto)</p><div
class="confluence-information-macro confluence-information-macro-note"><span
class="aui-icon aui-icon-small aui-iconfont-warning
confluence-information-macro-icon"></span><div
class="confluence-information-macro-body"><p>When building Your application
<strong>DO NOT INCLUDE THOSE COMPONENTS</strong>
again.</p></div></div></li></ul><h4
id="ApplicationServerSpecificConfigurationGuide-GetridofOC4JJAX-WSlibraries">Get
rid of OC4J JAX-WS libr
aries</h4><p>OC4J has <a shape="rect"
href="application-server-specific-configuration-guide.html">preliminary support
for JAX-WS</a>, unfortunately this means that during OC4J boot it loads
<em>outdated</em> JAX-WS APIs and implementation by Oracle. This occurs even
before shared libraries comes into action, at a very early stage of OC4J boot.
Boot-time OC4J libraries are configured in <code>boot.xml</code> file in
<code>$ORACLE_HOME/j2ee/home/oc4j.jar</code> bootstrap jar. To get rid of
this:</p><ul><li>unpack <code>oc4j.jar</code> file</li><li>locate
<code>META-INF/boot.xml</code> file and edit it</li><li>find
section</li></ul><div class="code panel pdl" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
+<pre class="brush: xml; gutter: false; theme: Default"
style="font-size:12px;"><!-- WS jax-rpc -->
<code-source path="${oracle.home}/webservices/lib/jaxr-api.jar"/>
<code-source
path="${oracle.home}/webservices/lib/jaxrpc-api.jar"/>
<code-source path="${oracle.home}/webservices/lib/jaxb-api.jar"/>
<code-source path="${oracle.home}/webservices/lib/saaj-api.jar"/>
<code-source path="${oracle.home}/webservices/lib/jws-api.jar"
if="java.specification.version == /1\.[5-6]/"/>
</pre>
-</div></div>
-<p>and comment out line which include <code>jws-api.jar</code> entry, like
below</p>
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
-<pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;">
-<!-- <code-source path="${oracle.home}/webservices/lib/jws-api.jar"
if="java.specification.version == /1\.[5-6]/"/> -->
+</div></div><p>and comment out line which include <code>jws-api.jar</code>
entry, like below</p><div class="code panel pdl" style="border-width:
1px;"><div class="codeContent panelContent pdl">
+<pre class="brush: xml; gutter: false; theme: Default"
style="font-size:12px;"><!-- <code-source
path="${oracle.home}/webservices/lib/jws-api.jar"
if="java.specification.version == /1\.[5-6]/"/> -->
</pre>
-</div></div>
-<ul><li>repackage <code>oc4j.jar</code> (don't forget about
<code>MANIFEST.MF</code> - use <code>jar -m
META-INF/MANIFEST.MF</code>)</li></ul>
-
-
-<p><span class="confluence-anchor-link"
id="ApplicationServerSpecificConfigurationGuide-wsdl4j"></span></p>
-
-<h4
id="ApplicationServerSpecificConfigurationGuide-swappingOraclewsdl.jarwithwsdl4j.jarandjaxb.jarAPIwithjaxb-api-2.0.jar">swapping
Oracle <code>wsdl.jar</code> with <code>wsdl4j.jar</code> and
<code>jaxb.jar</code> API with <code>jaxb-api-2.0.jar</code></h4>
-
-<p>Additionally Oracle provides it's own implementation of WSDL functionality
which conflicts with <code>wsdl4j.jar</code>. To get rid of this add
<code>-Xbootclasspath/p:"<path to wsdlj>/wsdl4j-1.6.1.jar;<path to
jaxb2>/jaxb-api-2.0.jar"</code> option to JVM parametrs (either in command
line running OC4J standalone or in OPMN).</p>
-
-<h4
id="ApplicationServerSpecificConfigurationGuide-Deployingapplications">Deploying
applications</h4>
-
-<p>When deploying please follow those steps:</p>
-<ul><li>Edit deployment plan</li><li>Edit <code>Configure class loading</code>
in the deployment plan like described <a shape="rect" class="external-link"
href="http://www.oracle.com/technology/tech/java/oc4j/1013/how_to/how-to-swapxmlparser/doc/readme.html"
rel="nofollow">here</a></li><li><strong>Uncheck</strong>
<code><strong>oracle.xml</strong></code> library</li><li><strong>Check</strong>
<code><strong>cxf.foundation</strong></code>
library</li><li><strong>Uncheck</strong> <code><strong>Search Local Classes
First</strong></code></li><li>do not include <code>xercesImpl</code>,
<code>xml-apis</code>, <code>xalan</code> and
<code>geronimo-ws-metadata_2.0_spec-1.1.1.jar</code> in <code>war</code> -
those will be automatically loaded by by OC4J Shared Libraries class loader.
-<div class="confluence-information-macro
confluence-information-macro-tip"><span class="aui-icon aui-icon-small
aui-iconfont-approve confluence-information-macro-icon"></span><div
class="confluence-information-macro-body">
-<p>You can automate above steps by packaging You <code>war</code> into
<code>ear</code> archive (even though) if it's only <code>war</code> and
providing <code>orion-application.xml</code> proprietary descriptor as
described <a shape="rect" class="external-link"
href="http://download-west.oracle.com/docs/cd/B32110_01/web.1013/b28952/classload.htm#CIHIHDEG"
rel="nofollow">here</a>. You could also provide proprietary
<code>orion-web.xml</code> in Your <code>war</code> instrumenting <code>Search
Local Classes First</code> attribute described above. This step is described <a
shape="rect" class="external-link"
href="http://www.oracle.com/technology/tech/java/oc4j/htdocs/how-to-servlet-sysclassloader.html"
rel="nofollow">here</a>.</p></div></div></li></ul>
-
-
-<h4 id="ApplicationServerSpecificConfigurationGuide-OracleFAQ">Oracle FAQ</h4>
-
-
-<h5
id="ApplicationServerSpecificConfigurationGuide-I'mgettingjava.lang.ClassCastException:org.apache.xerces.jaxp.DocumentBuilderFactoryImpl">I'm
getting <code>java.lang.ClassCastException:
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl</code></h5>
-
-<p>This primarily happens when:</p>
-<ul><li>xerces is loaded twice - by shared library class loader and
application class loader</li><li>or when there is mismatch between
<code>xerces</code> and <code>oracle</code> implementation of SAX API</li></ul>
-
-
-<p>Please be sure You properly installed and enabled for Your application
<code>cxf.foundation</code> shared library as described <a shape="rect"
href="application-server-specific-configuration-guide.html">here</a>. If Yes
please be sure that You didn't include xercesImpl.jar in Your <code>war</code>.
If You still have problems please <a shape="rect" class="external-link"
href="http://java.sun.com/javase/6/docs/api/javax/xml/parsers/SAXParserFactory.html#newInstance()"
rel="nofollow">see how You can debug JAXP problems</a> - be sure that
<code>org.apache.xerces.jaxp.DocumentBuilderFactoryImpl</code> are instantiated
from within <code>JAXP</code> and not
<code>oracle.xml.parser.v2.DocumentBuilder</code>.</p>
-
-<p><span class="confluence-anchor-link"
id="ApplicationServerSpecificConfigurationGuide-f2"></span></p>
-
-<h5
id="ApplicationServerSpecificConfigurationGuide-IcannotgetWSDL(gettingHTTP500accesingmyCXFserviceWSDLwithhttp://myshot/myservice?wsdl)">I
cannot get WSDL (getting HTTP 500 accesing my CXF service WSDL with <a
shape="rect" class="external-link" href="http://myshot/myservice?wsdl"
rel="nofollow">http://myshot/myservice?wsdl</a>)</h5>
-
-<p>Please be sure that <code>wsdl4j.jar</code> is loaded before
<code>wsdl.jar</code> as described <a shape="rect"
href="application-server-specific-configuration-guide.html">here</a></p>
-
-<h5
id="ApplicationServerSpecificConfigurationGuide-I'mgettingjava.lang.NoSuchMethodException:oracle.j2ee.ws.wsdl.extensions.soap.SOAPBodyImpl.getElementType()">I'm
getting <code>java.lang.NoSuchMethodException:
oracle.j2ee.ws.wsdl.extensions.soap.SOAPBodyImpl.getElementType()</code></h5>
-
-<p><a shape="rect"
href="application-server-specific-configuration-guide.html">See this</a></p>
-
-<h5 id="ApplicationServerSpecificConfigurationGuide-Icannotgetittoworkstill">I
cannot get it to work still</h5>
-
-<p>Try something simple. Download OC4J standalone and bootstrap it from
command line directly: <code>java [options] -jar oc4j.jar</code>. Enable <a
shape="rect" class="external-link"
href="http://java.sun.com/javase/6/docs/api/javax/xml/parsers/SAXParserFactory.html#newInstance()"
rel="nofollow">SAX debugging</a>. Be sure You don't include douplicated jars
in Your application like <code>xercesImpl, xalan, xml-apis and
geronimo-ws-metadata_2.0_spec-1.1.1.jar</code>. Review steps above once more.
It works <img class="emoticon emoticon-wink"
src="https://cwiki.apache.org/confluence/s/en_GB/5982/f2b47fb3d636c8bc9fd0b11c0ec6d0ae18646be7.1/_/images/icons/emoticons/wink.png"
data-emoticon-name="wink" alt="(wink)"> .</p>
-
-<h2
id="ApplicationServerSpecificConfigurationGuide-IntegrationwithApplicationServerFAQ">Integration
with Application Server FAQ</h2>
-
-<p>1.<br clear="none">
-Q: I have this error: javax.xml.ws.WebServiceException: Cannot create SAAJ
factory instance.<br clear="none">
-A: Please make sure you have the saaj-impl-1.3.jar in the classpath and make
sure your app picks up this one instead of weblogic one.</p>
-
-<h2 id="ApplicationServerSpecificConfigurationGuide-Resources">Resources</h2>
-
-<p><a shape="rect" class="external-link"
href="http://download-uk.oracle.com/docs/cd/B25221_03/web.1013/b14433/classload.htm"
rel="nofollow">Utilizing the OC4J Class Loading Framework</a><br clear="none">
-<a shape="rect" class="external-link"
href="http://xfire.codehaus.org/XFire+on+WebLogic+9.2" rel="nofollow">Deploy
XFire in WebLogic</a><br clear="none">
-<a shape="rect" class="external-link"
href="http://edocs.bea.com/wls/docs92/programming/classloading.html"
rel="nofollow">Understanding WebLogic ClassLoader</a><br clear="none">
-<a shape="rect" class="external-link"
href="http://www.jboss.org/wiki/Wiki.jsp?page=ClassLoadingConfiguration"
rel="nofollow">JBoss Class Configuration</a><br clear="none">
-<a shape="rect" class="external-link"
href="http://java.sun.com/javase/6/docs/api/javax/xml/parsers/SAXParserFactory.html#newInstance()"
rel="nofollow">Troubleshooting SAX</a></p></div>
+</div></div><ul><li>repackage <code>oc4j.jar</code> (don't forget about
<code>MANIFEST.MF</code> - use <code>jar -m
META-INF/MANIFEST.MF</code>)</li></ul><p><span class="confluence-anchor-link"
id="ApplicationServerSpecificConfigurationGuide-wsdl4j"></span></p><h4
id="ApplicationServerSpecificConfigurationGuide-swappingOraclewsdl.jarwithwsdl4j.jarandjaxb.jarAPIwithjaxb-api-2.0.jar">swapping
Oracle <code>wsdl.jar</code> with <code>wsdl4j.jar</code> and
<code>jaxb.jar</code> API with
<code>jaxb-api-2.0.jar</code></h4><p>Additionally Oracle provides it's own
implementation of WSDL functionality which conflicts with
<code>wsdl4j.jar</code>. To get rid of this add
<code>-Xbootclasspath/p:"<path to wsdlj>/wsdl4j-1.6.1.jar;<path to
jaxb2>/jaxb-api-2.0.jar"</code> option to JVM parametrs (either in command
line running OC4J standalone or in OPMN).</p><h4
id="ApplicationServerSpecificConfigurationGuide-Deployingapplications">Deploying
applications</h4><p>When deploying please fol
low those steps:</p><ul><li>Edit deployment plan</li><li>Edit <code>Configure
class loading</code> in the deployment plan like described <a shape="rect"
class="external-link"
href="http://www.oracle.com/technology/tech/java/oc4j/1013/how_to/how-to-swapxmlparser/doc/readme.html"
rel="nofollow">here</a></li><li><strong>Uncheck</strong>
<code><strong>oracle.xml</strong></code> library</li><li><strong>Check</strong>
<code><strong>cxf.foundation</strong></code>
library</li><li><strong>Uncheck</strong> <code><strong>Search Local Classes
First</strong></code></li><li><p>do not include <code>xercesImpl</code>,
<code>xml-apis</code>, <code>xalan</code> and
<code>geronimo-ws-metadata_2.0_spec-1.1.1.jar</code> in <code>war</code> -
those will be automatically loaded by by OC4J Shared Libraries class
loader.</p><div class="confluence-information-macro
confluence-information-macro-tip"><span class="aui-icon aui-icon-small
aui-iconfont-approve confluence-information-macro-icon"></span><div class=
"confluence-information-macro-body"><p>You can automate above steps by
packaging You <code>war</code> into <code>ear</code> archive (even though) if
it's only <code>war</code> and providing <code>orion-application.xml</code>
proprietary descriptor as described <a shape="rect" class="external-link"
href="http://download-west.oracle.com/docs/cd/B32110_01/web.1013/b28952/classload.htm#CIHIHDEG"
rel="nofollow">here</a>. You could also provide proprietary
<code>orion-web.xml</code> in Your <code>war</code> instrumenting <code>Search
Local Classes First</code> attribute described above. This step is described <a
shape="rect" class="external-link"
href="http://www.oracle.com/technology/tech/java/oc4j/htdocs/how-to-servlet-sysclassloader.html"
rel="nofollow">here</a>.</p></div></div></li></ul><h4
id="ApplicationServerSpecificConfigurationGuide-OracleFAQ">Oracle FAQ</h4><h5
id="ApplicationServerSpecificConfigurationGuide-I'mgettingjava.lang.ClassCastException:org.apache.xerces.jaxp.DocumentB
uilderFactoryImpl">I'm getting <code>java.lang.ClassCastException:
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl</code></h5><p>This primarily
happens when:</p><ul><li>xerces is loaded twice - by shared library class
loader and application class loader</li><li>or when there is mismatch between
<code>xerces</code> and <code>oracle</code> implementation of SAX
API</li></ul><p>Please be sure You properly installed and enabled for Your
application <code>cxf.foundation</code> shared library as described <a
shape="rect"
href="application-server-specific-configuration-guide.html">here</a>. If Yes
please be sure that You didn't include xercesImpl.jar in Your <code>war</code>.
If You still have problems please <a shape="rect" class="external-link"
href="http://java.sun.com/javase/6/docs/api/javax/xml/parsers/SAXParserFactory.html#newInstance()"
rel="nofollow">see how You can debug JAXP problems</a> - be sure that
<code>org.apache.xerces.jaxp.DocumentBuilderFactoryImpl</code> are instantia
ted from within <code>JAXP</code> and not
<code>oracle.xml.parser.v2.DocumentBuilder</code>.</p><p><span
class="confluence-anchor-link"
id="ApplicationServerSpecificConfigurationGuide-f2"></span></p><h5
id="ApplicationServerSpecificConfigurationGuide-IcannotgetWSDL(gettingHTTP500accesingmyCXFserviceWSDLwithhttp://myshot/myservice?wsdl)">I
cannot get WSDL (getting HTTP 500 accesing my CXF service WSDL with <a
shape="rect" class="external-link" href="http://myshot/myservice?wsdl"
rel="nofollow">http://myshot/myservice?wsdl</a>)</h5><p>Please be sure that
<code>wsdl4j.jar</code> is loaded before <code>wsdl.jar</code> as described <a
shape="rect"
href="application-server-specific-configuration-guide.html">here</a></p><h5
id="ApplicationServerSpecificConfigurationGuide-I'mgettingjava.lang.NoSuchMethodException:oracle.j2ee.ws.wsdl.extensions.soap.SOAPBodyImpl.getElementType()">I'm
getting <code>java.lang.NoSuchMethodException:
oracle.j2ee.ws.wsdl.extensions.soap.SOAPBodyImpl.getElementTyp
e()</code></h5><p><a shape="rect"
href="application-server-specific-configuration-guide.html">See this</a></p><h5
id="ApplicationServerSpecificConfigurationGuide-Icannotgetittoworkstill">I
cannot get it to work still</h5><p>Try something simple. Download OC4J
standalone and bootstrap it from command line directly: <code>java [options]
-jar oc4j.jar</code>. Enable <a shape="rect" class="external-link"
href="http://java.sun.com/javase/6/docs/api/javax/xml/parsers/SAXParserFactory.html#newInstance()"
rel="nofollow">SAX debugging</a>. Be sure You don't include douplicated jars
in Your application like <code>xercesImpl, xalan, xml-apis and
geronimo-ws-metadata_2.0_spec-1.1.1.jar</code>. Review steps above once more.
It works <img class="emoticon emoticon-wink"
src="https://cwiki.apache.org/confluence/s/en_GB/5982/f2b47fb3d636c8bc9fd0b11c0ec6d0ae18646be7.1/_/images/icons/emoticons/wink.png"
data-emoticon-name="wink" alt="(wink)"> .</p><h2
id="ApplicationServerSpecificConfigurationGuide-In
tegrationwithApplicationServerFAQ">Integration with Application Server
FAQ</h2><p>1.<br clear="none"> Q: I have this error:
javax.xml.ws.WebServiceException: Cannot create SAAJ factory instance.<br
clear="none"> A: Please make sure you have the saaj-impl-1.3.jar in the
classpath and make sure your app picks up this one instead of weblogic
one.</p><h2
id="ApplicationServerSpecificConfigurationGuide-Resources">Resources</h2><p><a
shape="rect" class="external-link"
href="http://download-uk.oracle.com/docs/cd/B25221_03/web.1013/b14433/classload.htm"
rel="nofollow">Utilizing the OC4J Class Loading Framework</a><br clear="none">
<a shape="rect" class="external-link"
href="http://xfire.codehaus.org/XFire+on+WebLogic+9.2" rel="nofollow">Deploy
XFire in WebLogic</a><br clear="none"> <a shape="rect" class="external-link"
href="http://edocs.bea.com/wls/docs92/programming/classloading.html"
rel="nofollow">Understanding WebLogic ClassLoader</a><br clear="none"> <a
shape="rect" class="external-li
nk" href="http://www.jboss.org/wiki/Wiki.jsp?page=ClassLoadingConfiguration"
rel="nofollow">JBoss Class Configuration</a><br clear="none"> <a shape="rect"
class="external-link"
href="http://java.sun.com/javase/6/docs/api/javax/xml/parsers/SAXParserFactory.html#newInstance()"
rel="nofollow">Troubleshooting SAX</a></p></div>
</div>
<!-- Content -->
</td>
Modified: websites/production/cxf/content/docs/jax-rs-deployment.html
==============================================================================
--- websites/production/cxf/content/docs/jax-rs-deployment.html (original)
+++ websites/production/cxf/content/docs/jax-rs-deployment.html Thu Jun 9
14:47:39 2016
@@ -117,12 +117,12 @@ Apache CXF -- JAX-RS Deployment
<!-- Content -->
<div class="wiki-content">
<div
id="ConfluenceContent"><p> </p><p> </p><p> </p><p> </p><p> <span
class="inline-first-p" style="font-size:2em;font-weight:bold">JAX-RS :
Deployment</span> </p><p> </p><p> </p><p> </p><p> </p><p><style
type="text/css">/*<![CDATA[*/
-div.rbtoc1441374390412 {padding: 0px;}
-div.rbtoc1441374390412 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1441374390412 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1465483620428 {padding: 0px;}
+div.rbtoc1465483620428 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1465483620428 li {margin-left: 0px;padding-left: 0px;}
-/*]]>*/</style></p><div class="toc-macro rbtoc1441374390412">
-<ul class="toc-indentation"><li><a shape="rect"
href="#JAX-RSDeployment-ServletContainers">Servlet Containers</a>
+/*]]>*/</style></p><div class="toc-macro rbtoc1465483620428">
+<ul class="toc-indentation"><li><a shape="rect"
href="#JAX-RSDeployment-SpringBoot">Spring Boot</a></li><li><a shape="rect"
href="#JAX-RSDeployment-ServletContainers">Servlet Containers</a>
<ul class="toc-indentation"><li><a shape="rect"
href="#JAX-RSDeployment-Tomcat">Tomcat</a></li></ul>
</li><li><a shape="rect"
href="#JAX-RSDeployment-ApplicationServers">Application Servers</a>
<ul class="toc-indentation"><li><a shape="rect"
href="#JAX-RSDeployment-Glassfish">Glassfish</a></li><li><a shape="rect"
href="#JAX-RSDeployment-JBoss">JBoss</a></li><li><a shape="rect"
href="#JAX-RSDeployment-WebLogic">WebLogic</a>
@@ -131,7 +131,7 @@ div.rbtoc1441374390412 li {margin-left:
<ul class="toc-indentation"><li><a shape="rect"
href="#JAX-RSDeployment-CXFRuntimeDelegate.1">CXF RuntimeDelegate</a></li></ul>
</li></ul>
</li></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 id="JAX-RSDeployment-ServletContainers">Servlet
Containers</h1><h2 id="JAX-RSDeployment-Tomcat">Tomcat</h2><p>1. System
"org.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH"<br clear="none"> 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.<br clear="none"> 2. When using mod_jk - ensure that the JkOptions
setting has +ForwardURICompatUnparsed set. <br clear="none"> 3. Windows:
upgrade isapi_redirect.dll if you see URI containing encoded spaces being
decoded by Tomcat.</p><h1 id="JAX-RSDeployment-ApplicationServers">Application
Servers</h1><h2
id="JAX-RSDeployment-Glassfish">Glassfish</h2><p><strong>Verified with
Glassfish Server Open Source Edition 3.1.1</strong></p><p>1. Make sure a
cxf-rt-transport-http-jetty dependency is excluded during the war
build</p><p>2. If a custom JAX-RS <a shape="rect" class="external-link"
href="http://jsr311.java.net/nonav/releases/1.1/index.html"
rel="nofollow">Application</a> is included then<br clear="none"> use a <a
shape="rect"
href="http://cxf.apache.org/docs/jaxrs-services-configuration.html#JAXRSServicesConfiguration-ConfiguringJAXRSservicesincontainerwithoutSpring">CXFNonSpringJaxrsServlet</a>
to reference the Application implementation class and either <br clear="none">
2.1 Disable the Jersey scanning the custom web applications. Setting the
following system property may help:<br clear="none">
"-Dcom.sun.enterprise.overrideablejavaxpackages=javax.ws.rs,javax.ws.rs.core,javax.ws.rs.ext"</p><p>2.2
Remove jersey-gf-server.jar from $GLASSFISH_HOME/glassfish/modules</p><h2
id="JAX-RSDeployment-JBoss">JBoss</h2><p><strong>Verified with JBoss AS
7.1.0.CR1b</strong></p><p>1. If a custom JAX-RS <a shape="rect"
class="external-link
" href="http://jsr311.java.net/nonav/releases/1.1/index.html"
rel="nofollow">Application</a> is included then<br clear="none"> use a <a
shape="rect"
href="http://cxf.apache.org/docs/jaxrs-services-configuration.html#JAXRSServicesConfiguration-ConfiguringJAXRSservicesincontainerwithoutSpring">CXFNonSpringJaxrsServlet</a>
to reference the Application implementation class and either</p><p>1.1 Disable
the RestEasy scanning the custom web applications (TODO: specify how this
actually can be done)<br clear="none"> 1.2 Modify
$JBOSS_HOME/standalone/configuration/standalone.xml by commenting out a
"org.jboss.as.jaxrs" extension and a "urn:jboss:domain:jaxrs:1.0"
sybsystem.</p><p>2. JBoss does not support URI path slashes by default: <a
shape="rect" class="external-link" href="http://securitytracker.com/id/1018110"
rel="nofollow">http://securitytracker.com/id/1018110</a></p><h2
id="JAX-RSDeployment-WebLogic">WebLogic</h2><p><strong>Verified with WebLogic
Server 12c (12.1.1)</strong></p><h3 i
d="JAX-RSDeployment-SpecifyingaWebLogicspecificJSPservlet">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 pdl" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
+</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 id="JAX-RSDeployment-SpringBoot">Spring
Boot</h1><p>Please see CXF <a shape="rect"
href="springboot.html">SpringBoot</a> documenation. </p><h1
id="JAX-RSDeployment-ServletContainers">Servlet Containers</h1><h2
id="JAX-RSDeployment-Tomcat">Tomcat</h2><p>1. System
"org.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH"<br clear="none"> 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.<br clear="none"> 2. When using mod_jk - ensure that the JkOptions
setting has +ForwardURICompatUnparsed set. <br clear="none"> 3. Windows:
upgrade isapi_redirect.dll if you see URI containing encoded spaces being
decoded by Tomcat.</p><h1 id="JAX-RSDeployment-ApplicationServers">Application
Se
rvers</h1><h2
id="JAX-RSDeployment-Glassfish">Glassfish</h2><p><strong>Verified with
Glassfish Server Open Source Edition 3.1.1</strong></p><p>1. Make sure a
cxf-rt-transport-http-jetty dependency is excluded during the war
build</p><p>2. If a custom JAX-RS <a shape="rect" class="external-link"
href="http://jsr311.java.net/nonav/releases/1.1/index.html"
rel="nofollow">Application</a> is included then<br clear="none"> use a <a
shape="rect"
href="http://cxf.apache.org/docs/jaxrs-services-configuration.html#JAXRSServicesConfiguration-ConfiguringJAXRSservicesincontainerwithoutSpring">CXFNonSpringJaxrsServlet</a>
to reference the Application implementation class and either <br clear="none">
2.1 Disable the Jersey scanning the custom web applications. Setting the
following system property may help:<br clear="none">
"-Dcom.sun.enterprise.overrideablejavaxpackages=javax.ws.rs,javax.ws.rs.core,javax.ws.rs.ext"</p><p>2.2
Remove jersey-gf-server.jar from $GLASSFISH_HOME/glassfish/modules</p><h
2 id="JAX-RSDeployment-JBoss">JBoss</h2><p><strong>Verified with JBoss AS
7.1.0.CR1b</strong></p><p>1. If a custom JAX-RS <a shape="rect"
class="external-link"
href="http://jsr311.java.net/nonav/releases/1.1/index.html"
rel="nofollow">Application</a> is included then<br clear="none"> use a <a
shape="rect"
href="http://cxf.apache.org/docs/jaxrs-services-configuration.html#JAXRSServicesConfiguration-ConfiguringJAXRSservicesincontainerwithoutSpring">CXFNonSpringJaxrsServlet</a>
to reference the Application implementation class and either</p><p>1.1 Disable
the RestEasy scanning the custom web applications (TODO: specify how this
actually can be done)<br clear="none"> 1.2 Modify
$JBOSS_HOME/standalone/configuration/standalone.xml by commenting out a
"org.jboss.as.jaxrs" extension and a "urn:jboss:domain:jaxrs:1.0"
sybsystem.</p><p>2. JBoss does not support URI path slashes by default: <a
shape="rect" class="external-link" href="http://securitytracker.com/id/1018110"
rel="nofollow">http:/
/securitytracker.com/id/1018110</a></p><h2
id="JAX-RSDeployment-WebLogic">WebLogic</h2><p><strong>Verified with WebLogic
Server 12c (12.1.1)</strong></p><h3
id="JAX-RSDeployment-SpecifyingaWebLogicspecificJSPservlet">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 pdl" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
<pre class="brush: xml; gutter: false; theme: Default"
style="font-size:12px;"><servlet>
<servlet-name>jsp</servlet-name>
<servlet-class>weblogic.servlet.JSPServlet</servlet-class>
Modified: websites/production/cxf/content/docs/jaxrs-services-configuration.html
==============================================================================
--- websites/production/cxf/content/docs/jaxrs-services-configuration.html
(original)
+++ websites/production/cxf/content/docs/jaxrs-services-configuration.html Thu
Jun 9 14:47:39 2016
@@ -118,11 +118,11 @@ Apache CXF -- JAXRS Services Configurati
<!-- Content -->
<div class="wiki-content">
<div
id="ConfluenceContent"><p> </p><p> </p><p> </p><p> <span
class="inline-first-p" style="font-size:2em;font-weight:bold">JAX-RS : Services
Configuration</span> </p><p> </p><p> </p><p> </p><p><style
type="text/css">/*<![CDATA[*/
-div.rbtoc1459252016587 {padding: 0px;}
-div.rbtoc1459252016587 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1459252016587 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1465483620070 {padding: 0px;}
+div.rbtoc1465483620070 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1465483620070 li {margin-left: 0px;padding-left: 0px;}
-/*]]>*/</style></p><div class="toc-macro rbtoc1459252016587">
+/*]]>*/</style></p><div class="toc-macro rbtoc1465483620070">
<ul class="toc-indentation"><li><a shape="rect"
href="#JAXRSServicesConfiguration-ConfiguringJAX-RSservicesprogrammatically">Configuring
JAX-RS services programmatically</a></li><li><a shape="rect"
href="#JAXRSServicesConfiguration-OSGI">OSGI</a>
<ul class="toc-indentation"><li><a shape="rect"
href="#JAXRSServicesConfiguration-Blueprint">Blueprint</a></li><li><a
shape="rect" href="#JAXRSServicesConfiguration-Spring">Spring</a></li></ul>
</li><li><a shape="rect" href="#JAXRSServicesConfiguration-SpringBoot">Spring
Boot</a></li><li><a shape="rect"
href="#JAXRSServicesConfiguration-ConfiguringJAX-RSendpointsprogrammaticallywithoutSpring">Configuring
JAX-RS endpoints programmatically without Spring</a></li><li><a shape="rect"
href="#JAXRSServicesConfiguration-BlueprintWeb">Blueprint Web</a>
@@ -203,148 +203,7 @@ sf.create();
</beans>
</pre>
-</div></div><h1 id="JAXRSServicesConfiguration-SpringBoot">Spring
Boot</h1><p>Example1:</p><p> </p><div class="code panel pdl"
style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;">package sample.rs.service;
-import org.apache.cxf.endpoint.Server;
-import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;
-import org.apache.cxf.jaxrs.spring.JaxRsConfig;
-import org.apache.cxf.transport.servlet.CXFServlet;
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.boot.context.embedded.ServletRegistrationBean;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Import;
-
-@SpringBootApplication
-@Import(JaxRsConfig.class)
-public class SampleRestApplication {
- public static void main(String[] args) {
- SpringApplication.run(SampleRestApplication.class, args);
- }
-
- @Bean
- public ServletRegistrationBean servletRegistrationBean(ApplicationContext
context) {
- return new ServletRegistrationBean(new CXFServlet(), "/services/*");
- }
-
-
- @Bean
- public Server rsServer() {
- JAXRSServerFactoryBean endpoint = new JAXRSServerFactoryBean();
- endpoint.setServiceBean(new HelloService());
- endpoint.setAddress("/helloservice");
- return endpoint.create();
- }
-
-}</pre>
-</div></div><p> </p><p>Example2:</p><p> </p><div class="code panel
pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;">package sample.rs.service;
-import org.apache.cxf.jaxrs.spring.SpringComponentScanServer;
-import org.apache.cxf.transport.servlet.CXFServlet;
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.boot.context.embedded.ServletRegistrationBean;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Import;
-
-
-@SpringBootApplication
-@Import(SpringComponentScanServer.class)
-public class SampleScanRestApplication {
- public static void main(String[] args) {
- SpringApplication.run(SampleScanRestApplication.class, args);
- }
-
-
- @Bean
- public ServletRegistrationBean servletRegistrationBean(ApplicationContext
context) {
- return new ServletRegistrationBean(new CXFServlet(),
"/services/helloservice/*");
- }
-
-
-
- @Bean
- public HelloService helloService() {
- return new HelloService();
- }
-
-}</pre>
-</div></div><p> </p><p>Example3:</p><p> </p><div class="code panel
pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;">/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package sample.rs.service;
-import java.util.Collections;
-import java.util.Set;
-
-import javax.servlet.ServletConfig;
-import javax.ws.rs.ApplicationPath;
-import javax.ws.rs.core.Application;
-
-import org.apache.cxf.jaxrs.servlet.CXFNonSpringJaxrsServlet;
-import org.apache.cxf.jaxrs.spring.JaxRsConfig;
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.boot.context.embedded.ServletRegistrationBean;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Import;
-
-@SpringBootApplication
-@Import(JaxRsConfig.class)
-public class SampleScanRestApplication2 {
- public static void main(String[] args) {
- SpringApplication.run(SampleScanRestApplication2.class, args);
- }
-
- @Bean
- public ServletRegistrationBean servletRegistrationBean(ApplicationContext
context) {
- Application app = (Application)context.getBean("helloApp");
- @SuppressWarnings("serial")
- CXFNonSpringJaxrsServlet servlet = new CXFNonSpringJaxrsServlet(app) {
- @Override
- protected boolean isIgnoreApplicationPath(ServletConfig
servletConfig) {
- return false;
- }
-
- };
- return new ServletRegistrationBean(servlet, "/*");
- }
-
-
- @Bean
- public Application helloApp() {
- return new JaxrsApplication();
- }
-
- @ApplicationPath("/services/helloservice")
- public static class JaxrsApplication extends Application {
- public Set<Object> getSingletons() {
- return Collections.<Object>singleton(new HelloService());
- }
- }
-
-}
-
-</pre>
-</div></div><p> </p><p> </p><p> </p><p>Please also check the
classes in this <a shape="rect" class="external-link"
href="https://git-wip-us.apache.org/repos/asf?p=cxf.git;a=tree;f=rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring;h=2c0dc8fef3aa4fdbd06cbedcd93e0f329739711b;hb=HEAD">package</a>
and this <a shape="rect" class="external-link"
href="https://github.com/apache/cxf/tree/master/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot"
rel="nofollow">demo</a>.</p><p>(Here is a <a shape="rect"
class="external-link"
href="https://github.com/apache/cxf/tree/master/distribution/src/main/release/samples/jaxws_spring_boot"
rel="nofollow">demo</a> for JAX-WS users).</p><p> </p><h1
id="JAXRSServicesConfiguration-ConfiguringJAX-RSendpointsprogrammaticallywithoutSpring">Configuring
JAX-RS endpoints programmatically without Spring</h1><p>Note that even though
no Spring is explicitly used in the previous section, it is still used by
default to have var
ious CXF components registered with the bus such as transport factories. If no
Spring libraries are available on the classpath then please follow the
following example :</p><div class="code panel pdl" style="border-width:
1px;"><div class="codeContent panelContent pdl">
+</div></div><h1 id="JAXRSServicesConfiguration-SpringBoot">Spring
Boot</h1><p>Please see CXF <a shape="rect"
href="springboot.html">SpringBoot</a> documenation. </p><p> </p><h1
id="JAXRSServicesConfiguration-ConfiguringJAX-RSendpointsprogrammaticallywithoutSpring">Configuring
JAX-RS endpoints programmatically without Spring</h1><p>Note that even though
no Spring is explicitly used in the previous section, it is still used by
default to have various CXF components registered with the bus such as
transport factories. If no Spring libraries are available on the classpath then
please follow the following example :</p><div class="code panel pdl"
style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;">JAXRSServerFactoryBean sf = new
JAXRSServerFactoryBean();
sf.setResourceClasses(CustomerService.class);
sf.setResourceProvider(CustomerService.class, new
SingletonResourceProvider(new CustomerService()));