users@jaxb.java.net

Re: jaxb.properties and bgm.ser files in a jar

From: Ryan Shoemaker - JavaSoft East <Ryan.Shoemaker_at_Sun.COM>
Date: Mon, 27 Jan 2003 17:18:55 -0500

zhidong zhao wrote:
> After many unsuccessful trails I found the best way is not to create an new instance of
> jaxbcontext, where you get lots of strange (and stupid) exceptions regarding properties and
> bgm.ser, but create an ObjectFactory object which comes with the compiled package. In fact
> ObjectFactory is an extension of JAXBContext class. You can use ObjectFactory in places whereever
> jaxbcontext is needed, such as create objects or marshaller/unmarshaller/validator. The api
> example code was misleading.
>

This is a known issue with the beta release. Please make sure that jaxb.properties
and bgm.ser are on the classpath rather than in a jar. This problem has been resolved
in the 1.0 release which should be available very soon.

You are correct about the use of the generated ObjectFactory, but please be advised
that you are taking advantage of a feature specific to the RI - your client code will
likely not be portable to other JAXB vendors.

Thanks,

--Ryan Shoemaker, Sun Microsystems, Inc.