[jboss-user] [JBoss Web Services] - Using apache cxf.xml with a jax-ws client

Daniel Cote do-not-reply at jboss.com
Wed Mar 13 10:06:40 EDT 2013


Daniel Cote [https://community.jboss.org/people/daniel.cote.qc.ca] created the discussion

"Using apache cxf.xml with a jax-ws client"

To view the discussion, visit: https://community.jboss.org/message/802369#802369

--------------------------------------------------------------
Hi forum,

I'm taking the chance to put here an entry refering to my previous post made on the more general 'Jboss AS 7' community ( https://community.jboss.org/thread/222322 cxf.xml and spring and jbossws-cxf-4.1.1.Final)
Since the topic is really related to the Web service stack, I hope I'll can get back some additional clues...

To summarize:

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.

I did the upgrate using instructions provider in  https://community.jboss.org/docs/DOC-13545 https://community.jboss.org/wiki/JBossWS-Installation.

* I'm working with JBOSS 7.1.1 final.  I updated the jboss-cxf stack to  *jbossws-cxf-4.1.1.Final*, including the installation of spring, using *-Dspring=true option*, which I found is required in order for my cxf.xml file to be recognized by the runtime.
* 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).

Ex.:
23:45:47,303 FINE (http-localhost-127.0.0.1-8080-1) org.apache.cxf.bus.spring.BusEntityResolver.resolveEntity Attempting to resolve systemId http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
23:45:48,270 FINE (http-localhost-127.0.0.1-8080-1) org.apache.cxf.bus.spring.BusEntityResolver.resolveEntity Attempting to resolve systemId http://cxf.apache.org/schemas/configuration/http-conf.xsd
23:45:48,676 FINE (http-localhost-127.0.0.1-8080-1) org.apache.cxf.bus.spring.BusEntityResolver.resolveEntity Attempting to resolve systemId http://cxf.apache.org/schemas/wsdl/http-conf.xsd
23:45:48,926 FINE (http-localhost-127.0.0.1-8080-1) org.apache.cxf.bus.spring.BusEntityResolver.resolveEntity Attempting to resolve systemId http://schemas.xmlsoap.org/wsdl/2003-02-11.xsd 
...


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 spring.schemas defines the location).

* the namespace handlers, 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 *NameSpace handler,* 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

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 at 31906846: startup date [Wed Mar 13 08:42:20 EDT 2013]; root of context hierarchy
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.
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]]
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]
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]
08:42:20,184 FINE (http-localhost-127.0.0.1-8080-1) org.apache.cxf.bus.spring.BusEntityResolver.resolveEntity Attempting to resolve systemId http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
08:42:20,932 FINE (http-localhost-127.0.0.1-8080-1) org.apache.cxf.bus.spring.BusEntityResolver.resolveEntity Attempting to resolve systemId http://cxf.apache.org/schemas/configuration/http-conf.xsd
08:42:21,307 FINE (http-localhost-127.0.0.1-8080-1) org.apache.cxf.bus.spring.BusEntityResolver.resolveEntity Attempting to resolve systemId http://cxf.apache.org/schemas/wsdl/http-conf.xsd
08:42:21,556 FINE (http-localhost-127.0.0.1-8080-1) org.apache.cxf.bus.spring.BusEntityResolver.resolveEntity Attempting to resolve systemId http://schemas.xmlsoap.org/wsdl/2003-02-11.xsd
08:42:22,134 FINE (http-localhost-127.0.0.1-8080-1) org.apache.cxf.bus.spring.BusEntityResolver.resolveEntity Attempting to resolve systemId http://cxf.apache.org/schemas/configuration/parameterized-types.xsd
08:42:22,258 FINE (http-localhost-127.0.0.1-8080-1) org.apache.cxf.bus.spring.BusEntityResolver.resolveEntity Attempting to resolve systemId http://cxf.apache.org/schemas/configuration/security.xsd
08:42:22,383 FINE (http-localhost-127.0.0.1-8080-1) org.apache.cxf.bus.spring.BusEntityResolver.resolveEntity Attempting to resolve systemId http://cxf.apache.org/schemas/configuration/cxf-beans.xsd
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 at 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: U*nable to locate Spring NamespaceHandler for XML schema namespace [http://cxf.apache.org/transports/http/configuration]*
*Offending resource: class path resource [cxf.xml]*

 at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68) [spring-beans.jar:3.0.7.RELEASE]
 at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85) [spring-beans.jar:3.0.7.RELEASE]
 at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:80) [spring-beans.jar:3.0.7.RELEASE]
 at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.error(BeanDefinitionParserDelegate.java:284) [spring-beans.jar:3.0.7.RELEASE]
...


* 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.
* I followed some suggestions regarding the use of EAR\META-INF\jboss-deployment-structure.xml, but none resolved the classloading problems.  I tried the followings

jboss-deployment-structure.xml with no dependencies, except the ones required by my application (oracle driver, configuration parameters)
jboss-deployment-structure.xml with:
        <module name="org.apache.cxf" export="true">
            <imports>
                <include path="META-INF**"/>
                <include path="org**"/>
            </imports>    
        </module>
 
jboss-deployment-structure.xml with:
        <module name="org.apache.cxf" export="true">
            <imports>
                <include path="META-INF**"/>
                <include path="org**"/>
            </imports>    
        </module>


jboss-deployment-structure.xml with:
        <module name="org.springframework.spring" export="true">
            <imports>
                <include path="META-INF**"/>
                <include path="org**"/>
            </imports>    
        </module>
        <module name="org.apache.cxf" export="true">
            <imports>
                <include path="META-INF**"/>
                <include path="org**"/>
            </imports>    
        </module>


jboss-deployment-structure.xml with:
        <module name="org.jboss.ws.cxf.jbossws-cxf-client" export="true">

        </module>
    (this one did NOT retrieve my cxf.xml configuration file...)


* 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 

Thanks
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/802369#802369]

Start a new discussion in JBoss Web Services at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2044]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20130313/4a51c464/attachment-0001.html 


More information about the jboss-user mailing list