users@jaxb.java.net

RE: JAXBContext.newInstance Issue

From: Lichtenwalter, Ryan <ryan.lichtenwalter_at_lmco.com>
Date: Wed, 08 Nov 2006 09:44:10 -0600

Kohsuke,

It might also be helpful to know that I only get this failure when I
deploy this to my application server. When I do the same with a
standalone client, it works fine. I am using the Sun Java System
Application Server PE9 (Glassfish bundled with NetBeans 5.5) but I have
taken care to always update the libraries on the server side as well as
include all JAXB libraries in the classpath.

Ryan

-----Original Message-----
From: Kohsuke Kawaguchi [mailto:Kohsuke.Kawaguchi_at_Sun.COM]
Sent: Tuesday, November 07, 2006 5:47 PM
To: users_at_jaxb.dev.java.net
Subject: Re: JAXBContext.newInstance Issue

Lichtenwalter, Ryan wrote:
> This is very strange because I honestly do not know what changed to
> break things. Before, my JAXB web service worked fine; now,
> JAXBContext.newInstance( packageName, this.getClass().getClassLoader()

> ) fails. My stack trace is below. The main error thrown is a generic
> NullPointerException
>
> Some things I checked myself:
>
> Is the version of JAXB on the server and the version compiling the
> schema the same? Yes.
> Are there any potential collisions on class names or package names?
No.
> Does loading the classes with JAXBContext.newInstance( { class1.class,

> class2.class, etc.class } ) work? No.
>
> Additionally, I have researched this problem and found sites such as
>
> http://forums.java.net/jive/thread.jspa?threadID=18479
> http://forums.java.net/jive/thread.jspa?messageID=165946
>
> but I still have no idea what the root cause of the problem is. Also,
> the only suggestion, adding a non-default class loader, does not work
> for me. Are there any ideas offhand what I could be doing incorrectly?
> Thank you.

This is one bug that I still fails to reproduce. I put some more
diagnostics in the 2.0 line so that I can get more info when this
happens again in the field.

Can you try tomorrow's JAXB 2.0.x nightly and see what you get?


--
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com