This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes Web Services and the fly likes JAXB Unmarshalling Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "JAXB Unmarshalling" Watch "JAXB Unmarshalling" New topic

JAXB Unmarshalling

Teena George
Ranch Hand

Joined: May 01, 2008
Posts: 82

I am trying for unmarshalling with JAXB. I am getting an error msg
Exception in thread "main" javax.xml.bind.JAXBException
- with linked exception:
[java.lang.ClassNotFoundException: com.sun.xml.bind.v2.ContextFactory]
at javax.xml.bind.ContextFinder.newInstance(
at javax.xml.bind.ContextFinder.find(
at javax.xml.bind.JAXBContext.newInstance(
at javax.xml.bind.JAXBContext.newInstance(
at com.jax.PersonUnmarshaller2.main(
Caused by: java.lang.ClassNotFoundException: com.sun.xml.bind.v2.ContextFactory
at Method)
at java.lang.ClassLoader.loadClass(
at sun.misc.Launcher$AppClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(
at javax.xml.bind.ContextFinder.newInstance(
... 4 more

Am i missing something
Can somebody help me in solving this issue?
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
Make sure you have a JAR file containing JAXB implementation, such as jaxb-impl-2.1.5.jar, on your classpath.
The missing class is supposed to be located in the JAXB implementation JAR.
Best wishes!

My free books and tutorials:
Teena George
Ranch Hand

Joined: May 01, 2008
Posts: 82

Thank you Ivan. It works now.

I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: JAXB Unmarshalling
It's not a secret anymore!