尽管定义了依赖项,但仍获取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

查看:941
本文介绍了尽管定义了依赖项,但仍获取java.lang.ClassNotFoundException:com.sun.xml.internal.ws.spi.ProviderImpl的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尽管我已经定义了相关的依赖关系(如我在下面添加的那样),但当我的应用程序调用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屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆