users@jaxb.java.net

JAXB - ClassCastException

From: CANDAT Jerome <jerome.candat_at_c-s.fr>
Date: Thu, 11 Dec 2003 11:59:20 +0100

Hello everyone,

I have an undefined problem with JAXB.

I'm developping a tool (let's call it A) using JAXB. It's working very well on its own.

However, for demonstration purposes, I created a launcher tool which invoke the methods of my tools.
When I launch my A tool using this launcher program I get a ClassCastException :

java.lang.ClassCastException: com.sun.xml.bind.DefaultJAXBContextImpl
        at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:281)
        at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:238)
        at A.Configuration.<clinit>(Tool.java:152)
        at A.Model.loadSemanticConfiguration(Model.java:99)
        at A.init(AManager.java:153)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)

What is odd is that this error does not appear when I launch the tool A directly !!

Any idea of what is wrong in my case ?

Thanks in advance,
Jérôme