users@jaxb.java.net

Re: JAXBContext.newInstance Issue

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Mon, 13 Nov 2006 11:35:51 -0800

Lichtenwalter, Ryan wrote:
> I found the cause of the problem. In looking through the stack trace, I
> found that in one file commented lines were supposedly causing the
> exception! Obviously that wasn't right. It turns out that when I
> deployed the web service using JAXB onto the application server, it was
> using its own version of JAXB 2.0, the same one that comes with the
> JWDSP. Even when I updated the JAXB jar files in the server library with
> each new build you released, it made no difference because the file
> appservws.jar has to exist for the application server to startup and as
> long as it does exist any updated JAXB jars are ignored.
>
> In any case, I solved the problem by reverting to the JWDSP version of
> JAXB 2.0. Now JAXBContext.newInstance works fine again. I am still
> confused about if changing builds of JAXB 2.0 should result in this
> error? Also, perhaps there is some more hinting way to handle this
> problem than with the NullPointerException?

OK. So if I understand your e-mail correctly, the reason why we aren't
seeing any change in the reported problem is that despite your
overwriting the JAXB RI jars, the app server keeps picking up the old one.

If that's the case, no matter how much error diagnostics I put in newer
versions of the JAXB RI, it won't help, because it just won't be picked up!

I agree that NPE is a really poor way of handling a problem. I believe
the modern RIs do better than that.

As for the JWSDP version, I really don't want people to be using it,
because it's known to be incompatible with the final released version of
the JAXB 2.0 spec.

What app server do you use? If it's Sun's app server, I'll talk to
whoever owns it and find out how to replace the jars reliably.

Thank you for all your debugging effort!

-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com