<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
Using apache cxf.xml with a jax-ws client
</h3>
<span style="margin-bottom: 10px;">
created by <a href="https://community.jboss.org/people/daniel.cote.qc.ca">Daniel Cote</a> in <i>JBoss Web Services</i> - <a href="https://community.jboss.org/message/802369#802369">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>Hi forum,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I'm taking the chance to put here an entry refering to my previous post made on the more general 'Jboss AS 7' community (<a class="jive-link-thread-small" href="https://community.jboss.org/thread/222322">cxf.xml and spring and jbossws-cxf-4.1.1.Final</a>)</p><p>Since the topic is really related to the Web service stack, I hope I'll can get back some additional clues...</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>To summarize:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I my quest to make my webservice client working with a specific configuration, I did upgrate my JBOSS 7.1.1 final with jbossws-cxf-4.1.1.Final.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I did the upgrate using instructions provider in <a class="jive-link-wiki-small" href="https://community.jboss.org/docs/DOC-13545" target="_blank">https://community.jboss.org/wiki/JBossWS-Installation</a>.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><ul><li style="text-align: start;">I'm working with JBOSS 7.1.1 final.  I updated the jboss-cxf stack to <strong> jbossws-cxf-4.1.1.Final</strong>, including the installation of spring, using <code class="jive-code"><strong>-Dspring=true option</strong>, </code>which I found is required in order for my cxf.xml file to be recognized by the runtime.</li><li style="text-align: start;">the declaration of the springs schemas NOT recognized by my current installation.  When I shutdowm my network services, I can see the attempt to resolve the schemas failed because the definition, included in the ..jboss-as-7.1.1.Final\modules\org\apache\cxf\impl\main jars file are NOT correctly resolved (hence the fallback on the http).</li></ul><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="font-family: courier new,courier;">Ex.:</span></p><p><span style="font-family: courier new,courier;">23:45:47,303 FINE (http-localhost-127.0.0.1-8080-1) org.apache.cxf.bus.spring.BusEntityResolver.resolveEntity Attempting to resolve systemId <a class="jive-link-external-small" href="http://www.springframework.org/schema/beans/spring-beans-2.0.xsd" rel="nofollow" target="_blank">http://www.springframework.org/schema/beans/spring-beans-2.0.xsd</a></span></p><p><span style="font-family: courier new,courier;">23:45:48,270 FINE (http-localhost-127.0.0.1-8080-1) org.apache.cxf.bus.spring.BusEntityResolver.resolveEntity Attempting to resolve systemId <a class="jive-link-external-small" href="http://cxf.apache.org/schemas/configuration/http-conf.xsd" rel="nofollow" target="_blank">http://cxf.apache.org/schemas/configuration/http-conf.xsd</a></span></p><p><span style="font-family: courier new,courier;">23:45:48,676 FINE (http-localhost-127.0.0.1-8080-1) org.apache.cxf.bus.spring.BusEntityResolver.resolveEntity Attempting to resolve systemId <a class="jive-link-external-small" href="http://cxf.apache.org/schemas/wsdl/http-conf.xsd" rel="nofollow" target="_blank">http://cxf.apache.org/schemas/wsdl/http-conf.xsd</a></span></p><p><span style="font-family: courier new,courier;">23:45:48,926 FINE (http-localhost-127.0.0.1-8080-1) org.apache.cxf.bus.spring.BusEntityResolver.resolveEntity Attempting to resolve systemId <a class="jive-link-external-small" href="http://schemas.xmlsoap.org/wsdl/2003-02-11.xsd" rel="nofollow" target="_blank">http://schemas.xmlsoap.org/wsdl/2003-02-11.xsd</a> </span></p><p><span style="font-family: courier new,courier;">...</span></p><p><span style="font-family: courier new,courier;"><br/></span></p><p><span style="font-family: arial,helvetica,sans-serif;">Are all going through the network instead of using the provided schemas (example: ...jboss-as-7.1.1.Final\modules\org\apache\cxf\impl\main\cxf-rt-transports-http.jar\schemas\configuration\  contains the http-conf.xsd... and the </span>spring.schemas defines the location<span style="font-family: arial,helvetica,sans-serif;">).</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><ul><li style="text-align: start;">the <span style="text-decoration: underline;">namespace handlers</span>, declared in the .jboss-as-7.1.1.Final\modules\org\apache\cxf\impl\main jars file are NOT correctly resolved as we can see in the following trace, where the runtime was unable to locate the<strong> NameSpace handler,</strong> altough this specifc handler is exposed by the jboss-as-7.1.1.Final\modules\org\apache\cxf\impl\main\cxf-rt-transports-http.jar\META-INF\spring.handlers</li></ul><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="font-family: courier new,courier;">08:42:20,168 INFO (http-localhost-127.0.0.1-8080-1) org.apache.cxf.bus.spring.BusApplicationContext.prepareRefresh Refreshing org.apache.cxf.bus.spring.BusApplicationContext@31906846: startup date [Wed Mar 13 08:42:20 EDT 2013]; root of context hierarchy</span></p><p><span style="font-family: courier new,courier;">08:42:20,184 INFO (http-localhost-127.0.0.1-8080-1) org.apache.cxf.bus.spring.BusApplicationContext.getConfigResources Loaded configuration file cxf.xml.</span></p><p><span style="font-family: courier new,courier;">08:42:20,184 FINE (http-localhost-127.0.0.1-8080-1) org.apache.cxf.bus.spring.BusApplicationContext.getConfigResources Creating application context with resources: [class path resource [META-INF/cxf/cxf.xml], class path resource [cxf.xml]]</span></p><p><span style="font-family: courier new,courier;">08:42:20,184 INFO (http-localhost-127.0.0.1-8080-1) org.apache.cxf.bus.spring.ControlledValidationXmlBeanDefinitionReader.loadBeanDefinitions Loading XML bean definitions from class path resource [META-INF/cxf/cxf.xml]</span></p><p><span style="font-family: courier new,courier;">08:42:20,184 INFO (http-localhost-127.0.0.1-8080-1) org.apache.cxf.bus.spring.ControlledValidationXmlBeanDefinitionReader.loadBeanDefinitions Loading XML bean definitions from class path resource [cxf.xml]</span></p><p><span style="font-family: courier new,courier;"><span>08:42:20,184 FINE (http-localhost-127.0.0.1-8080-1) org.apache.cxf.bus.spring.BusEntityResolver.resolveEntity Attempting to resolve systemId </span><a class="jive-link-external-small" href="http://www.springframework.org/schema/beans/spring-beans-2.0.xsd" rel="nofollow" target="_blank">http://www.springframework.org/schema/beans/spring-beans-2.0.xsd</a></span></p><p><span style="font-family: courier new,courier;"><span>08:42:20,932 FINE (http-localhost-127.0.0.1-8080-1) org.apache.cxf.bus.spring.BusEntityResolver.resolveEntity Attempting to resolve systemId </span><a class="jive-link-external-small" href="http://cxf.apache.org/schemas/configuration/http-conf.xsd" rel="nofollow" target="_blank">http://cxf.apache.org/schemas/configuration/http-conf.xsd</a></span></p><p><span style="font-family: courier new,courier;"><span>08:42:21,307 FINE (http-localhost-127.0.0.1-8080-1) org.apache.cxf.bus.spring.BusEntityResolver.resolveEntity Attempting to resolve systemId </span><a class="jive-link-external-small" href="http://cxf.apache.org/schemas/wsdl/http-conf.xsd" rel="nofollow" target="_blank">http://cxf.apache.org/schemas/wsdl/http-conf.xsd</a></span></p><p><span style="font-family: courier new,courier;"><span>08:42:21,556 FINE (http-localhost-127.0.0.1-8080-1) org.apache.cxf.bus.spring.BusEntityResolver.resolveEntity Attempting to resolve systemId </span><a class="jive-link-external-small" href="http://schemas.xmlsoap.org/wsdl/2003-02-11.xsd" rel="nofollow" target="_blank">http://schemas.xmlsoap.org/wsdl/2003-02-11.xsd</a></span></p><p><span style="font-family: courier new,courier;"><span>08:42:22,134 FINE (http-localhost-127.0.0.1-8080-1) org.apache.cxf.bus.spring.BusEntityResolver.resolveEntity Attempting to resolve systemId </span><a class="jive-link-external-small" href="http://cxf.apache.org/schemas/configuration/parameterized-types.xsd" rel="nofollow" target="_blank">http://cxf.apache.org/schemas/configuration/parameterized-types.xsd</a></span></p><p><span style="font-family: courier new,courier;"><span>08:42:22,258 FINE (http-localhost-127.0.0.1-8080-1) org.apache.cxf.bus.spring.BusEntityResolver.resolveEntity Attempting to resolve systemId </span><a class="jive-link-external-small" href="http://cxf.apache.org/schemas/configuration/security.xsd" rel="nofollow" target="_blank">http://cxf.apache.org/schemas/configuration/security.xsd</a></span></p><p><span style="font-family: courier new,courier;"><span>08:42:22,383 FINE (http-localhost-127.0.0.1-8080-1) org.apache.cxf.bus.spring.BusEntityResolver.resolveEntity Attempting to resolve systemId </span><a class="jive-link-external-small" href="http://cxf.apache.org/schemas/configuration/cxf-beans.xsd" rel="nofollow" target="_blank">http://cxf.apache.org/schemas/configuration/cxf-beans.xsd</a></span></p><p><span style="font-family: courier new,courier;">08:42:22,524 WARN (http-localhost-127.0.0.1-8080-1) org.jboss.ws.cxf.createApplicationContext JBWS024027: Spring initial application context creation failed using classloader org.jboss.ws.common.utils.DelegateClassLoader@719b072f, will try again after having switched the current thread context classloader to ModuleClassLoader for Module "org.apache.cxf.impl:main" from local module loader @7b41aa25 (roots: C:\AppServer\jboss-as-7.1.1.Final\jboss-as-7.1.1.Final\modules): org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: <span style="font-size: 12pt;">U<strong><span>nable to locate Spring NamespaceHandler for XML schema namespace [</span><a class="jive-link-external-small" href="http://cxf.apache.org/transports/http/configuration" rel="nofollow" target="_blank">http://cxf.apache.org/transports/http/configuration</a><span>]</span></strong></span></span></p><p><strong style="font-family: courier new,courier;">Offending resource: class path resource [cxf.xml]</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="font-family: courier new,courier;"> at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68) [spring-beans.jar:3.0.7.RELEASE]</span></p><p><span style="font-family: courier new,courier;"> at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85) [spring-beans.jar:3.0.7.RELEASE]</span></p><p><span style="font-family: courier new,courier;"> at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:80) [spring-beans.jar:3.0.7.RELEASE]</span></p><p><span style="font-family: courier new,courier;"> at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.error(BeanDefinitionParserDelegate.java:284) [spring-beans.jar:3.0.7.RELEASE]</span></p><p><span style="font-family: courier new,courier;">...</span></p><p><span style="font-family: courier new,courier;"><br/></span></p><ul><li style="text-align: start;"><span style="font-family: arial,helvetica,sans-serif;">Those inabilities to resolve the NamespaceHandler and the provided schemas seems to indicate a problem of classloading, which is very difficult (for me) to diagnose.</span></li><li style="text-align: start;"><span style="font-family: arial,helvetica,sans-serif;">I followed some suggestions regarding the use of </span>EAR\META-INF\jboss-deployment-structure.xml, but none resolved the classloading problems.  I tried the followings</li></ul><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="text-align: start;">jboss-deployment-structure.xml with no dependencies, except the ones required by my application (oracle driver, configuration parameters)</p><p style="text-align: start;">jboss-deployment-structure.xml with:</p><p><code class="jive-code jive-xml">        <span class="jive-xml-tag" style="color: navy; font-weight: bold;"><module name="org.apache.cxf" export="true"></span></code></p><p><span style="font-family: monospace;">            </span><span class="jive-xml-tag" style="color: navy; font-weight: bold;"><imports></span></p><p><span style="font-family: monospace;">                </span><span class="jive-xml-tag" style="color: navy; font-weight: bold;"><include path="META-INF**"/></span></p><p><span style="font-family: monospace;">                </span><span class="jive-xml-tag" style="color: navy; font-weight: bold;"><include path="org**"/></span></p><p><span style="font-family: monospace;">            </span><span class="jive-xml-tag" style="color: navy; font-weight: bold;"></imports></span><span style="font-family: monospace;">    </span></p><p><span style="font-family: monospace;">        </span><span class="jive-xml-tag" style="color: navy; font-weight: bold;"></module></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"><span class="jive-xml-tag" style="color: navy; font-weight: bold;"> </span> </p><p>jboss-deployment-structure.xml with:</p><p><code class="jive-code jive-xml">        <span class="jive-xml-tag" style="color: navy; font-weight: bold;"><module name="org.apache.cxf" export="true"></span></code></p><p><span style="font-family: monospace;">            </span><span class="jive-xml-tag" style="color: navy; font-weight: bold;"><imports></span></p><p><span style="font-family: monospace;">                </span><span class="jive-xml-tag" style="color: navy; font-weight: bold;"><include path="META-INF**"/></span></p><p><span style="font-family: monospace;">                </span><span class="jive-xml-tag" style="color: navy; font-weight: bold;"><include path="org**"/></span></p><p><span style="font-family: monospace;">            </span><span class="jive-xml-tag" style="color: navy; font-weight: bold;"></imports></span><span style="font-family: monospace;">    </span></p><p><span style="font-family: monospace;">        </span><span class="jive-xml-tag" style="color: navy; font-weight: bold;"></module></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>jboss-deployment-structure.xml with:</p><p><code class="jive-code jive-xml">        <span class="jive-xml-tag" style="color: navy; font-weight: bold;"><module name="org.springframework.spring" export="true"></span><br/>            <span class="jive-xml-tag" style="color: navy; font-weight: bold;"><imports></span><br/>                <span class="jive-xml-tag" style="color: navy; font-weight: bold;"><include path="META-INF**"/></span><br/>                <span class="jive-xml-tag" style="color: navy; font-weight: bold;"><include path="org**"/></span></code></p><p><code class="jive-code jive-xml">            <span class="jive-xml-tag" style="color: navy; font-weight: bold;"></imports></span>    <br/>        <span class="jive-xml-tag" style="color: navy; font-weight: bold;"></module></span><br/>        <span class="jive-xml-tag" style="color: navy; font-weight: bold;"><module name="org.apache.cxf" export="true"></span></code></p><p><span style="font-family: monospace;">            </span><span class="jive-xml-tag" style="color: navy; font-weight: bold;"><imports></span></p><p><span style="font-family: monospace;">                </span><span class="jive-xml-tag" style="color: navy; font-weight: bold;"><include path="META-INF**"/></span></p><p><span style="font-family: monospace;">                </span><span class="jive-xml-tag" style="color: navy; font-weight: bold;"><include path="org**"/></span></p><p><span style="font-family: monospace;">            </span><span class="jive-xml-tag" style="color: navy; font-weight: bold;"></imports></span><span style="font-family: monospace;">    </span></p><p><span style="font-family: monospace;">        </span><span class="jive-xml-tag" style="color: navy; font-weight: bold;"></module></span><code class="jive-code jive-xml"><br/></code></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>jboss-deployment-structure.xml with:</p><p><code class="jive-code jive-xml">        <span class="jive-xml-tag" style="color: navy; font-weight: bold;"><module name="</span></code><span style="color: #0000ff;">org.jboss.ws.cxf.jbossws-cxf-client</span><code class="jive-code jive-xml"><span class="jive-xml-tag" style="color: navy; font-weight: bold;">" export="true"></span><br/></code></p><p><code class="jive-code jive-xml">        <span class="jive-xml-tag" style="color: navy; font-weight: bold;"></module></span></code></p><p><span class="jive-xml-tag" style="color: navy; font-weight: bold;">    (this one did NOT retrieve my cxf.xml configuration file...)</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><ul><li style="text-align: start;">Until now, I worked a lot to make thinks working using only a configuration file and the JAX-WS api, but if I cannot resolve this issue, I will have to fall back on using the CXF api directly </li></ul><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="text-align: start;">Thanks</p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/802369#802369">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss Web Services at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2044">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>