users@jaxb.java.net

Re: No ObjectFactory with an _at_XmlElementDecl

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Wed, 26 Jul 2006 17:53:05 -0700

Sekhar Vajjhala wrote:
> Use the JAXBContext.newInstance(...) method which takes a list of
> package names
>
> JAXBContext.newInstance("com.acme.foo:com.acme.bar")
>
> instead of JAXBContext.newInstance method that takes a list of classes.

Actually, it's usually preferable to do

JAXBContext.newInstance(
   com.acme.foo.ObjectFactory.class,
   com.acme.bar.ObjectFactory.class, ... );

as opposed to using the package names. They both work in the same way.

-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com