users@jaxb.java.net

RE: JAXBContext.newInstance Issue

From: Lichtenwalter, Ryan <ryan.lichtenwalter_at_lmco.com>
Date: Tue, 14 Nov 2006 08:57:57 -0600

Yes, I'm using Sun Java System Application Server PE9. The file that
causes the problem is appserv-ws.jar in the server's lib directory.
There may be some way to prepend another path to the classpath for the
server, but I am not sure how to do that for SJSAS.

Ryan

-----Original Message-----
From: Kohsuke Kawaguchi [mailto:Kohsuke.Kawaguchi_at_Sun.COM]
Sent: Monday, November 13, 2006 1:36 PM
To: users_at_jaxb.dev.java.net
Subject: Re: JAXBContext.newInstance Issue

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