java.lang.ClassCastException: com.sun.xml.bind.v2.runtime.JAXBContextImpl cannot be cast to javax.xm [message #718537] |
Wed, 24 August 2011 12:10  |
Eclipse User |
|
|
|
Hi I am getting same error,
But i am using Eclipse , jdk 6, Jboss 5, Sporing message listener. Weblogic 11g is using to send messages . Getting messages from WL Queue to my app thru some logic.
I am able to print xml messages in the console, but getting exception before unmarshal this,
Code :
JAXBContext jc = JAXBContext.newInstance("com.bopeep.gen");
Unmarshaller unmarshaller = jc.createUnmarshaller();
// unmarshall into Classes from a File
bilgMsg = (BILGMSG) unmarshaller.unmarshal( new StreamSource( new StringReader(stringMessage)));
Please see the below error and help to resolve this
Exception:
11:41:49,475 WARN [DefaultMessageListenerContainer] Execution of JMS message listener failed, and no ErrorHandler has been set.
java.lang.ClassCastException: com.sun.xml.bind.v2.runtime.JAXBContextImpl cannot be cast to javax.xml.bind.JAXBContext
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:149)
at javax.xml.bind.ContextFinder.find(ContextFinder.java:285)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:372)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:337)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext
Attachment: server.log
(Size: 24.02KB, Downloaded 538 times)
|
|
|
|
|
|
|
(no subject) [message #721365 is a reply to message #721076] |
Thu, 01 September 2011 11:00  |
Eclipse User |
|
|
|
I coudnt fine DomainClass.class.getClassLoader().
I used like below.
JAXBContext jc = JAXBContext.newInstance("com.dnb.bopeep.gen", this.getClass().getClassLoader());
but got the same exception.
|
|
|
Powered by
FUDForum. Page generated in 0.24918 seconds