Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

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]

Avatar

Level 1

Writing a test class for the one of the OSGI service using JAXBContext which came with aem-sdk. When executing the service JAXBContext is getting invoked perfectly.. But, from the test class when is calling same line of the actual class its throwing "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] " in Intellij Debug. Any suggestions, how can I resolve this issue..

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@KeerthiDundi Could be dependency issue with Intellij, please check the below conversation in Intellij for the same and the solution offered. 

https://youtrack.jetbrains.com/issue/IDEA-199578

https://youtrack.jetbrains.com/issue/TW-76866/javax.xml.bind.JAXBException-Implementation-of-JAXB-AP....

 

 

View solution in original post

3 Replies

Avatar

Correct answer by
Community Advisor

@KeerthiDundi Could be dependency issue with Intellij, please check the below conversation in Intellij for the same and the solution offered. 

https://youtrack.jetbrains.com/issue/IDEA-199578

https://youtrack.jetbrains.com/issue/TW-76866/javax.xml.bind.JAXBException-Implementation-of-JAXB-AP....

 

 

Avatar

Administrator

@KeerthiDundi Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.



Kautuk Sahni

Avatar

Level 1

Hello everyone, 

I added these dependencies in core/pom.xml file.

<dependency>

<groupId>javax.xml.bind</groupId>

<artifactId>jaxb-api</artifactId>

<version>2.3.1</version>

<scope>test</scope>

</dependency>


<dependency>

<groupId>com.sun.xml.bind</groupId>

<artifactId>jaxb-core</artifactId>

<version>2.3.0</version>

<scope>test</scope>

</dependency>


<dependency>

<groupId>com.sun.xml.bind</groupId>

<artifactId>jaxb-impl</artifactId>

<version>2.3.0</version>

<scope>test</scope>

</dependency>


<dependency>

<groupId>xerces</groupId>

<artifactId>xercesImpl</artifactId>

<version>2.12.2</version>

<scope>test</scope>

</dependency>

Also I invalidate the cache of the intellij. This worked for me. Thank you.