Closed pc-dhutton closed 3 years ago
A coworker ran into the same issue just because he was on jdk11. Basically the javax.* that’s missing has been removed since java 9.
You could try importing separate dependency suggested here https://stackoverflow.com/a/54518582
Or we ended up reverting to java 8 and in the end skipping the use of this sdk all together.
Good luck
@lawrence-leung-mox Thank you for the reply. I tried adding the below library as stack overflow suggested and got a new error. I looked into that one for a bit and haven't found a clear solution.
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-ri</artifactId>
<version>2.3.0</version>
<type>pom</type>
</dependency>
Error Message
java.lang.ClassCastException: class com.sun.xml.ws.client.sei.SEIStub cannot be cast to class org.apache.cxf.frontend.ClientProxy (com.sun.xml.ws.client.sei.SEIStub and org.apache.cxf.frontend.ClientProxy are in unnamed module of loader 'app') at org.apache.cxf.frontend.ClientProxy.getClient(ClientProxy.java:128) at com.exacttarget.fuelsdk.ETSoapConnection.
(ETSoapConnection.java:103) at com.exacttarget.fuelsdk.ETSoapConnection. (ETSoapConnection.java:210) at com.exacttarget.fuelsdk.ETClient.buildClients(ETClient.java:219) at com.exacttarget.fuelsdk.ETClient. (ETClient.java:197)
@pc-dhutton trying to get it working with java 11 will probably take more time than considering falling back to using a HTTP Client and connecting to SFMC thru REST API, or perhaps even downgrading your whole project to java 8. I know they are not ideal but are viable alternatives.
@lawrence-leung-mox same I agree. I'll leave the ticket open and maybe Salesforce Marketing Cloud will do something about it. Leaning towards a separate microservice that runs Java 8 while the rest of the stack runs Java 11
Works on Java 11 using this dependencies:
implementation 'com.github.salesforce-marketingcloud:fuelsdk:1.5.0'
implementation 'jakarta.xml.ws:jakarta.xml.ws-api:2.3.3'
implementation 'com.sun.xml.messaging.saaj:saaj-impl:1.5.1'
For me it worked on Java 11 with those dependencies. Funny part that if you put higher versions it simply won't work
javax.xml.bind jaxb-api 2.3.0 com.sun.xml.bind jaxb-core 2.3.0 com.sun.xml.bind jaxb-impl 2.3.0 com.sun.xml.messaging.saaj saaj-impl 1.5.0 javax.xml.ws jaxws-api 2.2.6
<dependency>
<groupId>com.github.salesforce-marketingcloud</groupId>
<artifactId>fuelsdk</artifactId>
<version>1.5.0</version>
<exclusions>
<exclusion>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-osgi</artifactId>
</exclusion>
</exclusions>
</dependency>
Hope it helps
Ok sweet! Thank you for the update. I'll try that within the next few days and report back
@pc-dhutton you can take a look on my PR. It successfully runs on Java 11 now
Hey everyone! Since #125 is merged this ticket is finally resolved. Thx to some external force which help us to move things forward. Congrats everyone for being able to finally use the library on Java 11 The new version 1.5.1 was also published 🎉
Confirmed that @red-avtovo fix has worked in 1.5.1! Thank you very much sir. Also, I found that our monolithic app was using older versions of saaj and the required SOAP dependencies for Fuel to work. These older dependencies created conflicts with Fuel which made it incompatible with the mono. So I separated Fuel 1.5.1 out into its own spring boot microservice running java 11 and it works perfectly now.
Describe the bug When upgrading the project SDK to Java 11 FuekSdk 1.5.0 does not work. It gives the below error.
To Reproduce
Change project Java SDK version from 8 to 11
Try to create a client in a test
Error is thrown
java.lang.NoClassDefFoundError: javax/jws/WebService
Expected behavior
new EtClient(config)
should initialize with the log message belowScreenshots
Code snippet
Environment
The bug has the severity
Additional context This solution does not work https://stackoverflow.com/questions/53727322/migration-from-jdk-8-to-jdk-11-cxf-generated-sources-unknown-imports