users@jaxb.java.net

Trouble running Java 7 byte code in Java 6

From: Jason Harrop <jharrop_at_gmail.com>
Date: Mon, 5 Oct 2009 19:27:28 +1100

Hi

Using XJC from RI (2.1.6) to generate classes;

When compiled and run with Java 6 (JAXB from Java 6 or RI), everything is fine.

When compiled by Java 7 (preview milestone 4), and run in Java 6, i get:

    com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 11 counts
of IllegalAnnotationExceptions
    Two classes have the same XML type name "XXX". Use @XmlType.name
and @XmlType.namespace to assign different names to them.

These are classes with the same name but in different packages,
included in my JAXBContext. Example offending pairs:

                at org.docx4j.wml.CTTwipsMeasure
                at org.docx4j.math.CTTwipsMeasure

                at org.docx4j.wml.STColorSchemeIndex
                at org.docx4j.dml.STColorSchemeIndex

                at org.docx4j.wml.STYAlign
                at org.docx4j.math.STYAlign

                at org.docx4j.wml.STXAlign
                at org.docx4j.math.STXAlign

I guess I can use @XmlType.namespace to assign different namespaces,
but it used to be enough that they were in different packages.

Any comments as to whether this behaviour is likely with the first GA
release of Java 7?

thanks

Jason