I am currently developping a Java server app that connect to another server with SOAP, retrieve some data and store it into a DB. I work on Eclipse Photon, Maven project.
My Soap client worked perfectly fine until now. For my db storage functions, I needed the JDBC SQL Server driver. But Eclipse told me that driver was compiled with a more recent version of Java.
I was on Java 8, I updated to Java 10 and now the driver works fine BUT my SOAP client doesn't work anymore ! Eclipse doesn't recognize the import javax.xml.soap I use for my Soap.
So I put into my pom.xml some dependencies for it like :
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.2.11</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>2.2.11</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.2.11</version>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.xml.soap/javax.xml.soap-api -->
<dependency>
<groupId>javax.xml.soap</groupId>
<artifactId>javax.xml.soap-api</artifactId>
<version>1.4.0</version>
</dependency>
The import of javax seemed to be recognized again by Eclipse so I compiled my project with Tomcar to launch it and after trying my Soap client it gives me the following error :
java.lang.Exception: Unable to create SOAP connection factory: Provider com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnectionFactory not found
Adding this dependency to my POM fixed the issue:
<dependency>
<groupId>com.sun.xml.messaging.saaj</groupId>
<artifactId>saaj-impl</artifactId>
<version>1.4.0</version>
</dependency>
It also fixes this error: javax.xml.soap.SOAPException: Unable to create message factory for SOAP: Unable to create SAAJ meta-factory: Provider com.sun.xml.internal.messaging.saaj.soap.SAAJMetaFactoryImpl not found
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With