Hi Team,
We are creating catalog plugin and i have created my StandaloneCatalog object and i want to convert the POJO into xml string. i have used the XMLWriter.writeXML() for the same.
Have added the below dependency to the pom.
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
</dependency>
While running the code, i encountered below exception.
"message": "Implementation of JAXB-API has not been found on module path or classpath.",
"stacktrace": [
"javax.xml.bind.JAXBException: Implementation of JAXB-API has not been found on module path or classpath.",
" - with linked exception:",
"[java.lang.ClassNotFoundException: com.sun.xml.internal.bind.v2.ContextFactory not found by com.hp.cloud.stratus.ico.plugin.spa-ico-catalog-plugin [2]]",
"\tat javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:278)",
I could resolve the exception by adding below dependency and i could create the xml string successfully.
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>2.3.3</version>
</dependency>
But the moment i added this dependency, i am not able to call the other KillBill APIs(osgiKillbillAPI.getCatalogUserApi().getCurrentCatalog() ), Getting the below exception.
"message": "java.lang.IllegalStateException: Failed to de-serialize catalog for tenantRecordId='1'",
"stacktrace": [
"java.lang.RuntimeException: java.lang.IllegalStateException: Failed to de-serialize catalog for tenantRecordId='1'",
Caused by: java.util.concurrent.ExecutionException: javax.xml.bind.JAXBException: ClassCastException: attempting to cast bundle://2.0:1/javax/xml/bind/JAXBContext.class to jar:file:/C:/Program%20Files/Java/jdk1.8.0_281/jre/lib/rt.jar!/javax/xml/bind/JAXBContext.class. Please make sure that you are specifying the proper ClassLoader.
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:192)
I have tried to add several libraries to resolve the issue. But issue still persist. Could you please check and let me know what needs to be done to resolve this error.