我们正在从 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/