Hi,
   I upgraded from 2.3.2 to 2.4, and I'm getting a NullPointerException when I 
try to create a dynamic client.

Code:

DynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance();
Client client = dcf.createClient(wsdlUrl, service, 
DynamicClientFactory.class.getClassLoader(), port);

stacktrace:

java.lang.NullPointerException
    at 
org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:67)
    at 
org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:84)
    at org.apache.cxf.endpoint.ClientImpl.<init>(ClientImpl.java:152)
    at 
org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:255)
    at 
org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:198)
    at 
org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:191)


Line 67 in WSDLServiceFactory is:
            definition = 
getBus().getExtension(WSDLManager.class).getDefinition(wsdlUrl);

I tested, and getBus().getExtension(WSDLManager.class) is returning null.


What's the proper way to make sure the bus has the extension manager / is 
properly initialized?  With 2.3.2, I didn't need to worry about it, but it 
looks like I do with 2.4.0.



A little more information: I'm including my code in an application that has a 
somewhat complex class loader hierarchy.  It worked as-is with 2.3.2.  The 
class loader used to load the CXF jars should be this class's classloader's 
parent.

Also, if I just write a POJO with a main method, and thow this in, it *does 
not* give me the NPE; the NPE only comes from inside the full application:

DynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance();
Bus bus = CXFBusFactory.getThreadDefaultBus();
WSDLManager extension = bus.getExtension(WSDLManager.class);

Thank you,
Kevin        

Reply via email to