java.lang.NoClassDefFoundError:javax/xml/bind/JAXBContext

java

Solution

Adding a dependency on jaxb-impl should be sufficient, as this transitively depends on jaxb-api, which is the JAR containing the class it's complaining about. In Java 6, `javax.xml.bind` is part of the JRE by default so it would work out of the box there.

Problem

I'm using JDK 1.5 in my web project and using maven for compile. I was facing this: ``` WebServiceException ("javax.xml.ws.WebServiceException: Provider com.sun.xml.ws.spi.ProviderImpl not found") ``` in my project. To fix that I used two approaches: - First, I add jaxws-rt-2.1.4 in my class path.(Also made entry in POM.xml) - Second, Added jar in jre/lib folder But after this I am facing this: ``` java.lang.NoClassDefFoundError:javax/xml/bind/JAXBContext ``` Does anyone have any idea that could help me?

Original source