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

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/53642287/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 00:51:30  来源:igfitidea点击:

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

java

提问by Patty

We are migrating to openjdk 11 from jdk 8. Some of our projects that uses soap to call third party apis are failing with error:

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

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

After doing some research, I tried by adding dependencies :

在做了一些研究之后,我尝试添加依赖项:

[ references:

[ 参考资料:

]

]

 <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>

Did not work. may I get an idea on the alternatives?

不工作。我可以对替代方案有所了解吗?

采纳答案by David Conrad

Include jaxws-apiin your dependencies:

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

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