Re: [JAX-WS] NullPointerException in Source)

From: James Strachan <>
Date: Thu, 1 Sep 2005 09:42:56 +0100

Aha! I've just spotted that the source is available on the site after-
all under the weekly binary downloads

The website clearly says in the 'Sources' section (https://jax- that the sources are in the other project - http:// which is why I've been trying to get

With the source its easier to debug :). So here's a patch...

I don't have CVS access so can't give you a CVS patch, but here's the
fix for the bug. Basically if no 'si' was passed in, the
ServiceContext was created with no WsdlContext. So I just ensured
that the WsdlContext was created irrespective of the value of
'si' (mostly just moving the braces around a little )

So here's my modified version of the build method...

     public static ServiceContext build(URL wsdlLocation, Class si,
EntityResolver er) throws WebServiceException {

         ServiceContext serviceContext = new ServiceContext(er);
         SIAnnotations serviceIFAnnotations = null;
         if (si != null) {

             serviceIFAnnotations = getSIAnnotations(si);
             if (serviceIFAnnotations == null )
                 throw new WebServiceException("Service Interface
Annotations required, exiting...");

         if(wsdlLocation == null)
             try {
// wsdlLocation = new URL
                 wsdlLocation = new URL(JAXWSUtils.getFileOrURLName
             } catch (MalformedURLException e) {
                 throw new WebServiceException(e);
         serviceContext.setWsdlContext(new WSDLContext

         if (si != null) {
             for (Class clazz : serviceIFAnnotations.classes) {
         return serviceContext;

This fixes my issue and I can now create a Service properly.


On 31 Aug 2005, at 20:01, Kathy Walsh wrote:

> James-
> What drop of the kaxws are you using-
> there have been bugs reported on this previously.
> Kathy
> wrote:
>> Any chance of turning on debug information in the nightly binary
>> distros? It makes debugging a bit hard.
>> Right now I'm trying to create a Service from the ServiceFactory,
>> specifying a URL to the WSDL and a QName and get this exception...
>> [junit] java.lang.NullPointerException
>> [junit] at
>> Source)
>> Which has me a bit stumped :). I'm still waiting to be allowed to
>> see the source code - in the meantime, anyone care to take a
>> guess at what's wrong? (BTW both parameters i'm passing in are
>> non-null and look valid to me).
>> James
>> -------
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:
>> For additional commands, e-mail:
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail: