[英]java.lang.NoClassDefFoundError:javax/xml/bind/JAXBContext
I'm using JDK 1.5 in my web project and using maven for compile. 我在我的web项目中使用JDK 1.5并使用maven进行编译。
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:
要解决这个问题,我使用了两种方法
But after this I am facing this: 但在此之后我面对这个:
java.lang.NoClassDefFoundError:javax/xml/bind/JAXBContext
Does anyone have any idea that could help me? 有没有人有任何想法可以帮助我?
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. 添加对jaxb-impl的依赖应该就足够了,因为这传递上依赖于jaxb-api,它是包含它所抱怨的类的JAR。 In Java 6,
javax.xml.bind
is part of the JRE by default so it would work out of the box there. 在Java 6中,
javax.xml.bind
默认是JRE的一部分,因此它可以在那里开箱即用。
add this dependency to pom 将此依赖项添加到pom
<dependency>
<groupId>javax.xml</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.1</version>
</dependency>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.