java - JDK 11 : java. lang.NoClassDefFoundError:javax/xml/ws/handler/soap/SOAPHandler

标签 java

我们正在从 jdk 8 迁移到 openjdk 11。我们的一些使用 soap 调用第三方 api 的项目失败并出现错误:

java.lang.NoClassDefFoundError: javax/xml/ws/handler/soap/SOAPHandler

经过一些研究,我尝试添加依赖项:

[ 引用文献:

]

 <dependency>
        <groupId>javax.annotation</groupId>
        <artifactId>javax.annotation-api</artifactId>
    </dependency>
    <dependency>
        <groupId>xml-apis</groupId>
        <artifactId>xml-apis</artifactId>
    </dependency>
    <dependency>
        <groupId>javax.xml.bind</groupId>
        <artifactId>jaxb-api</artifactId>
        <version>2.3.1</version>
    </dependency>
    <dependency>
        <groupId>com.sun.xml.bind</groupId>
        <artifactId>jaxb-core</artifactId>
        <version>2.3.0.1</version>
    </dependency>
    <dependency>
        <groupId>com.sun.xml.bind</groupId>
        <artifactId>jaxb-impl</artifactId>
        <version>2.3.1</version>
    </dependency>
    <dependency>
        <groupId>javax.xml.soap</groupId>
        <artifactId>javax.xml.soap-api</artifactId>
        <version>1.3.5</version>
    </dependency>

没用。我可以了解替代方案吗?

最佳答案

在您的依赖项中包含 jaxws-api:

<dependency>
    <groupId>javax.xml.ws</groupId>
    <artifactId>jaxws-api</artifactId>
    <version>2.3.1</version>
</dependency>

关于java - JDK 11 : java. lang.NoClassDefFoundError:javax/xml/ws/handler/soap/SOAPHandler,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53642287/

相关文章:

java - JWS 是否在小程序的 JAR 中加载 JAR?

java - Spring Query By Example 使用 "OR"

java - 读取非文本内容并将其写回文件

Java String 将 '&' 替换为 & 而不是 & 为 &amp;

java - Spring rest Controller 从查询参数中的 zoneddatetime 中删除加号

java - Delayer 与 Splitter 一起,消息不串行处理

java - 在 SpringMVC 的上下文中,如何拥有提供同一类的不同 JSON 表示的 Web 服务?

java - 无法验证 ANT 1.9.7 设置

java - maven-archetype-j2ee-simple 原型(prototype)日志记录模块

java - 确定哪个网络接口(interface)将用于 JDK 上的给定主机名