首页  编辑  

SpringBoot + JDK 17 调用WebService报错: com.sun.xml.internal.messaging.saaj.soap.SAAJMetaFactoryImpl not found

Tags: /Java/   Date Created:
SpringBoot 3.x, JDK 17,调用Web Service(SOAP)报错:
com.sun.xml.internal.messaging.saaj.soap.SAAJMetaFactoryImpl not found

解决方法:
在POM中,加入

<dependency>
       <groupId>org.glassfish.metro</groupId>
       <artifactId>webservices-rt</artifactId>
       <version>2.4.4</version>
</dependency>
<dependency>
        <groupId>org.glassfish.metro</groupId>
        <artifactId>webservices-api</artifactId>
        <version>2.4.4</version>
</dependency>

去掉其他的 
    <dependency>
        <groupId>com.sun.xml.ws</groupId>
        <artifactId>jaxws-rt</artifactId>
        <version>2.3.3</version>
    </dependency> 
    <dependency>
        <groupId>com.sun.xml.messaging.saaj</groupId>
        <artifactId>saaj-impl</artifactId>
        <version>2.0.1</version>
    </dependency>