dev@jaxb.java.net

Re: ISSUE USING XJC

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Tue, 02 Jan 2007 12:25:23 -0800

Ignacio Blanco wrote:
> Hi, I'm new using Jaxb and i'm trying to generate Java classes given a XML
> schema.
> The schema can be found at (
> http://www.intershipper.com/Interface/Intershipper/XML/v2.0/schemas/response.xsd
> ).
>
> I'm running xjc using maven (jaxb2-maven-plugin) and i get all the java
> classes generated perfectly, but when trying to unmarshall an xml message i
> get an error indicating that one of the xsd:elements is unrecognized
> (shipment).
> Searching the generated code, i realized that the ObjectFactory only
> contains an element:
> private final static QName _QueryID_QNAME = new QName("
> http://www.intershipper.com/Interface/Intershipper/XML/v2.0/schemas",
> "queryID");
> The thing is that used jaxb previously to generate the java classes given a
> schema and jaxb has generated an ObjectFactory class with all the top level
> elements.

I wonder somehow if you are invoking XJC multiple times with different
schemas, and they are overwriting previous results.

If so, you'd need to specify different package names for each invocation.


-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com