JBoss Community

Re: Problem with faults and classloaders in AS7

created by Alessio Soldano in JBoss Web Services Development - View the full discussion

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

Start a new discussion in JBoss Web Services Development at Community