users@jaxb.java.net

Re: JAXBContext

From: Ryan Shoemaker - JavaSoft East <Ryan.Shoemaker_at_sun.com>
Date: Tue, 17 Jun 2003 10:22:03 -0400

David Rosenstark wrote:

> Thanks for the response.
> I did some more examination. It does not seem to be a threading problem. It
> just seems to be that calling:
> JAXBContext.newInstance in the servlet init is the problem. After the call
> to init i checked and it is still null. However, if i do the new in the
> doPost once, it is good across multiple threads.
>
> This is the reason for NullPointerException.
>
> Now, why does the newInstance call fail in init of the servlet?
>

A few random thoughts come to mind: What servlet container are you
deploying into? Are you sure the init method is being invoked? Are
you calling super.init() in your init() method? It shouldn't matter,
but does your servlet implement SingleThreadModel?

--Ryan