Saturday, March 21, 2020

JAXB-API has not been found on module path exception in Liferay 7/DXP

We may encounter following JAXB-API error while working with Liferay OSGi JAX-RS rest modules. Build and deployment might be success but when we are trying to access the REST end-points we may see it in server console logs or in browser as well.

Example:


Error:


JAXBException occurred : Implementation of JAXB-API has not been found on module path or classpath.. com.sun.xml.internal.bind.v2.ContextFactory cannot be found by org.apache.aries.jax.rs.whiteboard_1.0.4


Solution:

Add following JVM argument to the server CATALINA_OPTS in setenv.bat or setenv.sh file based on Operating System.


-Djavax.xml.bind.JAXBContextFactory=com.sun.xml.bind.v2.ContextFactory


setenv.bat



How to add New JVM arguments to Liferay Portal Server, follow the below blog post.

Author

1 comment :

  1. Hi Meera Prince,

    Could you provide the explanation for this please?

    ReplyDelete

Recent Posts

Recent Posts Widget

Popular Posts