Skip to content
Advertisement

ClassNotFoundException: com.sun.xml.internal.ws.spi.ProviderImpl

I have added all the relevant dependencies in build.gradle file. Still, geting below error when I try to run the Invoke SOAP service. Shared dependencies section and error details. Using Java 11. There are lot of answers already on internet, but none of it seems to be working. Any Help/Suggestion would be appreciable.

JavaScript

Getting below error stacktrace

JavaScript

Advertisement

Answer

A2A: There are probably some issues in the internal referrencing may be.

You can follow this answer: JDK 11; JAX-WS; Provider com.sun.xml.internal.ws.spi.ProviderImpl not found

Basically the answer says you can try to include an older rt dependency as well:

JavaScript

The above is maven pom xml format.

Here is gradle format for you:

JavaScript

This will most probably resolve you issue.

EDIT: Post discussion in comments below:

The dependencies that worked are:

JavaScript

After above dependecies, there was an error related to

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

which can be resolved using the compatible SAAJ dependency:

JavaScript

Also while adding header there was an issue in adding header to request after the above saaj dependencies were added:

Previous code:

JavaScript

Updated code which works:

JavaScript

Refer below link for jaxws-rt runtime dependencies:

https://mvnrepository.com/artifact/com.sun.xml.ws/jaxws-rt/2.3.2

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement