Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » (no subject)
(no subject) [message #718546] Wed, 24 August 2011 12:10 Go to next message
chitti babu is currently offline chitti babu
Messages: 9
Registered: February 2011
Junior Member
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

[Updated on: Wed, 24 August 2011 15:01]

Report message to a moderator

(no subject) [message #719384 is a reply to message #718546] Fri, 26 August 2011 17:04 Go to previous message
Blaise Doughan is currently offline Blaise Doughan
Messages: 163
Registered: July 2009
Senior Member

Hi Chitti,

Are you attempting to use EclipseLink MOXy as your JAXB provider or the reference implementation? If you wish to use MOXy be sure to specify a file named jaxb.properties in with your domain classes with the following entry:

javax.xml.bind.context.factory=org.eclipse.persistence.jaxb.JAXBContextFactory

You also appear to be hitting a ClassLoader issue. You can try using

JAXBContext jc = JAXBContext.newInstance("com.bopeep.gen", DomainClass.class.getClassLoader());

-Blaise

[Updated on: Mon, 29 August 2011 10:09]

Report message to a moderator

Previous Topic:Incorrect OSGI versioning on milestone builds?
Next Topic:@PostConstruct method breaks DDL generation
Goto Forum:
  


Current Time: Tue Jul 29 06:43:15 EDT 2014

Powered by FUDForum. Page generated in 0.01588 seconds