cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <willem.ji...@gmail.com>
Subject Re: Upgrade to 2.4, NullPointerException
Date Wed, 11 May 2011 02:29:07 GMT
Hi,

What does your full application look like?
Can you double check your class path, make sure there is no other 
version of CXF?

Willem

On 5/11/11 10:19 AM, Kevin McClusky wrote:
> 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
>


-- 
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
          http://jnn.javaeye.com (Chinese)
Twitter: willemjiang

Connect at CamelOne May 24-26
The Open Source Integration Conference
http://camelone.com

Mime
View raw message