Hi ,
I have created custom service that convert json to xml. I used the below API to convert json to xml string,
Its giving proper result in my eclipse but when I created the component and trying to start the service its giving error "
Caused by: java.lang.NoClassDefFoundError: jakarta/xml/bind/JAXBException
at java.lang.Class.getDeclaredMethods0(Native Method) [rt.jar:1.8.0_181]
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) [rt.jar:1.8.0_181]
at java.lang.Class.privateGetPublicMethods(Class.java:2902) [rt.jar:1.8.0_181]
at java.lang.Class.getMethods(Class.java:1615) [rt.jar:1.8.0_181]
"
below is my component.xml,
Views
Replies
Total Likes
Hi @Amreen1 ,
Seems to be a JDK Issue.
Are you using JDK Version 9+ for this Project ?
Could we please use any version below JDK <=8 (jdk 1.8) and test this out.
I think lowering the Java Version will work here.
Please let us know in case otherwise.
Thanks,
Utkarsh
Views
Replies
Total Likes
Its working in my local eclipse. Only the problem with exported component.jar. Actually, i dont have my server access to check the jdk but i believe its 8 only. If it would have JDK Version 9+ but i have added all external jar dependency in component.xml,
Views
Replies
Total Likes
Hi @Amreen1,
In addition to that, You can add the "-XX:+IgnoreUnrecognizedVMOptions" to make the JVM silently ignore unrecognized options, instead of blowing up. But beware! Any other command-line arguments you use will no longer be validated for you by the JVM. This option works with Oracle/OpenJDK as well as IBM JDK (as of JDK 8sr4).
Thanks
Pranay
Views
Replies
Total Likes
In my eclipse its working fine. Where should I add?
Views
Replies
Total Likes
Hi @Amreen1,
Please try adding the below dependency to your project pom.xml and then build the project to see if this resolves the issue.
<dependency> <groupId>jakarta.xml.bind</groupId> <artifactId>jakarta.xml.bind-api</artifactId> <version>4.0.1</version> </dependency> |
Thanks
Pranay
Views
Replies
Total Likes
So when you are creating the jar file, open the jar file and check if the jar file contains the required jar's needed for your app.
As you are saying that, its working in your local system, so the issue is only with the same jar is not getting exported with the jar you are creating for the server or the jar version might me not compatible with server.
Views
Replies
Total Likes
Views
Replies
Total Likes
getting below error,
Views
Replies
Total Likes
Check your component.xml file, compare with adobe document for component creation. You might be missing in the section in which jar need to include in component.xml file
Include the jar in your DSC and reference it in the classpath node in the component.xml file.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies