尽管定义了依赖项,但仍获取java.lang.ClassNotFoundException:com.sun.xml.internal.ws.spi.ProviderImpl [英] Getting java.lang.ClassNotFoundException: com.sun.xml.internal.ws.spi.ProviderImpl despite the dependencies are defined
问题描述
尽管我已经定义了相关的依赖关系(如我在下面添加的那样),但当我的应用程序调用Web服务时却出现了java.lang.ClassNotFoundException: com.sun.xml.internal.ws.spi.ProviderImpl
异常.
Despite that I have defined the related dependencies as I have added below, getting the java.lang.ClassNotFoundException: com.sun.xml.internal.ws.spi.ProviderImpl
exception when my app makes a call to the web service.
<dependency>
<groupId>javax.xml.ws</groupId>
<artifactId>jaxws-api</artifactId>
<version>2.2.10</version>
</dependency>
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-rt</artifactId>
<version>2.2.10</version>
<type>pom</type>
</dependency>
p.s. Servlet容器是Apache Tomcat 9.0.4
.
p.s. The servlet container is Apache Tomcat 9.0.4
.
p.s. Java版本:9.0.1
.
p.s. Java version: 9.0.1
.
推荐答案
@reta回答的第一部分对我有用.这些是我pom(Java 10)的相关依赖项:
The first part of the answer by @reta works for me. These are the relevant dependencies from my pom (Java 10):
<dependency>
<groupId>javax.xml.ws</groupId>
<artifactId>jaxws-api</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>rt</artifactId>
<version>2.3.1</version>
</dependency>
这篇关于尽管定义了依赖项,但仍获取java.lang.ClassNotFoundException:com.sun.xml.internal.ws.spi.ProviderImpl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!