users@jaxb.java.net

Separate Code Generation

From: Hilco Wijbenga <hilco.wijbenga_at_gmail.com>
Date: Thu, 19 Oct 2006 10:16:26 -0700

Hi all,

I have the feeling that what I'm trying to do is fairly simple but I
don't seem to be able to get it to work. I have types.xsd, types.xjb,
rates.xsd, and rates.xjb.

SCENARIO A: Everything together:
xjc -d src_one types.xsd -b types.xjb rates.xsd -b rates.xjb
parsing a schema...
compiling a schema...
com/example/jaxb/rates/impl/runtime/SAXUnmarshallerHandler.java
:
com/example/jaxb/rates/impl/runtime/XMLSerializable.java
com/example/jaxb/types/impl/JAXBVersion.java
com/example/jaxb/types/impl/LocalizedStringImpl.java
com/example/jaxb/rates/Name.java
com/example/jaxb/rates/ObjectFactory.java
com/example/jaxb/rates/jaxb.properties
com/example/jaxb/rates/bgm.ser
com/example/jaxb/types/LocalizedString.java
com/example/jaxb/types/ObjectFactory.java
com/example/jaxb/types/bgm.ser
com/example/jaxb/types/jaxb.properties
com/example/jaxb/rates/impl/JAXBVersion.java
com/example/jaxb/rates/impl/NameImpl.java

SCENARIO B: Run xjc twice (once for types and once for rates):
xjc -d src_two types.xsd -b types.xjb ; xjc -d src_two rates.xsd -b rates.xjb
parsing a schema...
[WARNING] Schema contains no global element declaration.compiling a schema...
unknown location

com/example/jaxb/types/impl/runtime/NamespaceContext2.java
:
com/example/jaxb/types/impl/runtime/ValidationContext.java
com/example/jaxb/types/impl/JAXBVersion.java
com/example/jaxb/types/impl/LocalizedStringImpl.java
com/example/jaxb/types/LocalizedString.java
com/example/jaxb/types/ObjectFactory.java
com/example/jaxb/types/jaxb.properties
com/example/jaxb/types/bgm.ser
parsing a schema...
compiling a schema...
com/example/jaxb/rates/impl/runtime/GrammarInfoImpl.java
:
com/example/jaxb/rates/impl/runtime/ErrorHandlerAdaptor.java
com/example/jaxb/rates/Name.java
com/example/jaxb/rates/ObjectFactory.java
com/example/jaxb/rates/bgm.ser
com/example/jaxb/rates/jaxb.properties
com/example/schemas/types/impl/JAXBVersion.java
com/example/schemas/types/impl/LocalizedStringImpl.java
com/example/schemas/types/LocalizedString.java
com/example/schemas/types/ObjectFactory.java
com/example/schemas/types/bgm.ser
com/example/schemas/types/jaxb.properties
com/example/jaxb/rates/impl/JAXBVersion.java
com/example/jaxb/rates/impl/NameImpl.java

This leads me to a number of questions:
1. Google tells me that the [WARNING] is harmless. Does that include
""unknown location"? Or should I do something about that?
2. Why do some of the "types" files end up in
com/example/schemas/types in scenario B?
3. Why do I get way more files in scenario B? E.g., in scenario A
"types" doesn't have a "runtime" package.
4. What do I need to do for the two scenarios to generate the same code?

I've tried Google but I couldn't find anything. The JAXB specification
is of no help either.

The attached files are simplified versions of actual files in our
build. I know very little JAXB. :-(

Any comments, help or guidance would be very much appreciated.

Cheers,
Hilco