[jboss-dev-forums] [JBoss Web Services Development] - Re: Problem with faults and classloaders in AS7

Alessio Soldano do-not-reply at jboss.com
Fri Jun 3 04:40:00 EDT 2011


Alessio Soldano [http://community.jboss.org/people/asoldano] created the discussion

"Re: Problem with faults and classloaders in AS7"

To view the discussion, visit: http://community.jboss.org/message/608480#608480

--------------------------------------------------------------
Hi Andrew,
> Andrew Dinn wrote:
> 
> Hi Alessio,
> 
> I tried including both 'org.jboss.ws.jaxws-client services export' and 'org.jboss.ws.cxf.jbossws-cxf-client services export' in the dependences list but neither resolved the problem I had on the client side. When I looke dfurther into ti I realised that there is no service.xml override for the XPathFactory in the jbossws and cxf jars. The client fault handling code relies upon loading the hardwired fallback implementation class, com.sun..org.apache.xpath.internal.jaxp/XPathFactory, which is in rt.jar. This means that one of the jbossws or cxf modules needs to inport and then re-export it. I patched myrelease by adding the following to the dependencies set in module.xml file in modules/org/jboss/ws/jbossws-cxf-client/main
> 
>         <module name="system" export="false">
>             <imports>
>                 <include-set>
>                     <path name="com/sun/org/apache/xpath/internal/jaxp"/>
>                 </include-set>
>             </imports>
>             <exports>
>                 <include-set>
>                     <path name="com/sun/org/apache/xpath/internal/jaxp"/>
>                 </include-set>
>             </exports>
>         </module>
> 
> 
> 
> 
> 
> This ensures that ClientFaultConverter can see the hard-wired XPathFactory implementation.
> 
> 
OK, so th CXF XPathUtils needs to see a XPathFactory implementation. I have two concerns regarding your proposed solution:
* I don't think it's correct to force the default impl; afaik we do have custom implementation from Xalan module; btw there should be a +javax.xml.jaxp-provider+ module in AS7 for this. Can you try setting the dependency on that module and see if works too?
* I'm not really sure this dependency should live in the +org.jboss.ws.cxf.jbossws-cxf-client+ module, as this seems quite a common need (any standard client might suffer from this problem, regardless of it using cxf/jbossws-cxf customizations or not). This is probably something for the +org.jboss.ws.jaxws-client+ module, which is automatically loaded by the JAXWS Provider. On this topic, there's something I'd like to verify: you should be going through the +org.jboss.wsf.stack.cxf.client.ProviderImpl+ implementation of JAXWS Provider when doing the call from client; that provider is supposed to set the TCCL in createServiceDelegate(..) so that it use or delegate as fallback to the modular classloader for +org.jboss.ws.jaxws-client+ (that's why adding the dependency in there should be the solution for every client). Btw, this is required because the XPathUtils (as well as many other 3rd party code) relies on TCCL for loading stuff.
--------------------------------------------------------------

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

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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20110603/4bab2254/attachment.html 


More information about the jboss-dev-forums mailing list