Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JAVA - com.sun.xml.internal.messaging.saaj.soap.SAAJMetaFactoryImpl not found

I'm working on an application that consumes a web service using SOAP requests.

Sometimes I get this error:

filters.LoggerFilter:92 - org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.Error: javax.xml.soap.SOAPException: Unable to create SAAJ meta-factoryProvider com.sun.xml.internal.messaging.saaj.soap.SAAJMetaFactoryImpl not found

The weird part is that I get this error randomly, but I can't seem to figure out the cause.

I even added a new dependency, but it doesn't seem to correct the issue:

    <dependency>
        <groupId>com.sun.xml.messaging.saaj</groupId>
        <artifactId>saaj-impl</artifactId>
        <version>1.3</version>
    </dependency>
like image 712
guidev Avatar asked Dec 19 '17 12:12

guidev


3 Answers

I just had the same problem while using Java 11 to create an application that consumes SOAP-requests.

I added the new dependency and it worked fine for me.

<dependency>
    <groupId>com.sun.xml.messaging.saaj</groupId>
    <artifactId>saaj-impl</artifactId>
    <version>1.5.1</version>
</dependency>
like image 118
Amelie St. Avatar answered Nov 16 '22 00:11

Amelie St.


For those who face this issue in intellij IDEA using Spring Boot under Java SDK 9+, you have to include explicitly --add-modules java.se.ee in VM parameters (edit configurations -> VM options). This answer may help to resolve other importing issues related to new Java Modules

like image 24
rahimli Avatar answered Nov 16 '22 01:11

rahimli


For me, I was using Java 13 and the following worked for me(add these in the pom.xml)

    <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>
like image 4
Sam ツ Avatar answered Nov 16 '22 02:11

Sam ツ