Kathleen DiDomenico wrote:
>hi. When I run
> JAXBContext jc = JAXBContext.newInstance( "primer.po" );
>from the tutorial I get the following stackTrace. I have tried it with different xsd files and different packages.
>
>Any idea what this is?
>
You have two different version of the class
com.sun.msv.datatype.xsd.XSDatatypeImpl
that is causing a serialization failure.
Local class not compatible:
stream classdesc serialVersionUID=-6807414618091372945 (used by XJC
compiler and in bgm.ser)
localclass serialVersionUID=3812747094843142778 (version visible from
application classpath)
One version was used by the xjc binding compiler (that created the
bgm.ser serialization file )
and the other version is in the classpath when running your application.
I suspect that
you have experimented with MSV (Multi Schema Validator) that is a diffierent
version of MSV than the one distributed in the beta JAXB RI. Be careful
with your
classpath and be sure it consistently points to the same version of the
class.
(Sorry, but I don't know offhand which jar file contains the class in
question in the JAXB RI)
MSV was depending on the computed serial version UID technique rather
than explicitly setting it. Each subtle change to the MSV classes will
cause a
serialization incompatibility.
This serialization fragility has already been identified and addressed
so it won't
be a problem for future versions of MSV and JAXB RI. But in the short
term until
you get the next releases of both implementations, you will need to be
careful setting your classpath.
-Joe Fialli, Sun Microsystems
>
>Thanks,
>Kathleen
>
>java.lang.reflect.InvocationTargetException: java.lang.InternalError: com.sun.msv.datatype.xsd.XSDat
>atypeImpl; Local class not compatible: stream classdesc serialVersionUID=-6807414618091372945 local
>class serialVersionUID=3812747094843142778
> at com.sun.xml.bind.validator.SchemaDeserializer.deserialize(SchemaDeserializer.java:28)
> at primer.po.impl.PurchaseOrderTypeImpl.<clinit>(PurchaseOrderTypeImpl.java:20)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Unknown Source)
> at primer.po.ObjectFactory.class$(ObjectFactory.java:11)
> at primer.po.ObjectFactory.<clinit>(ObjectFactory.java:18)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Unknown Source)
> at com.sun.xml.bind.GrammarInfoFacade.createGrammarInfoFacade(GrammarInfoFacade.java:98)
> at com.sun.xml.bind.DefaultJAXBContextImpl.<init>(DefaultJAXBContextImpl.java:61)
> at com.sun.xml.bind.ContextFactory.createContext(ContextFactory.java:27)
> at java.lang.reflect.Method.invoke(Native Method)
> at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:99)
> at javax.xml.bind.ContextFinder.searchcontextPath(ContextFinder.java:200)
> at javax.xml.bind.ContextFinder.find(ContextFinder.java:126)
> at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:274)
> at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:231)
> at Main.main(Main.java:72)
>
>