azrael3192
azrael3192

Reputation: 37

Sometimes SAAJMetaFactoryImpl not found is thrown

I am using OpenJDK 11 and here's my code for Getting SOAP message. SOAPMessage message = MessageFactory.newInstance(dataDTO.getSoapVersion()).createMessage(null, new ByteArrayInputStream(encryptedResponse.getBytes()));

Sometimes it throws error:

javax.xml.soap.SOAPException: Unable to create SAAJ meta-factoryProvider com.sun.xml.internal.messaging.saaj.soap.SAAJMetaFactoryImpl not found at javax.xml.soap.SAAJMetaFactory.getInstance(SAAJMetaFactory.java:94) ~[saaj-api-1.3.5.jar:?]

I think it is because it looking for the method under saaj-api 1.3.5 instead of saaj-impl 1.5.1

below is my POM dependency:

<dependency>
        <groupId>javax.xml.soap</groupId>
        <artifactId>javax.xml.soap-api</artifactId>
        <version>1.4.0</version>
    </dependency>   
<dependency>
        <groupId>com.sun.xml.messaging.saaj</groupId>
        <artifactId>saaj-impl</artifactId>
        <version>1.5.1</version>
    </dependency>
    <dependency>
        <groupId>javax.xml.soap</groupId>
        <artifactId>saaj-api</artifactId>
        <version>1.3.5</version>
    </dependency>

Since javax.xml.soap-api 1.4.0 is using by some critical function, the risk is too high for removing it. Anyway can make sure my function work as expected with loading proper class ?

Upvotes: 1

Views: 988

Answers (0)

Related Questions