简体   繁体   中英

Wildfly 20 Upgrade and OpenJRE 8 - Implementation of JAXB-API has not been found on module path or classpath

We are using openjre-8.0.252.09-hotspot, upgraded from Wildfly 10 to Wildfly 20, and started facing following issue, although:

  • jaxb-impl-2.1.13.jar is already present in WEB-INF\lib
  • rt.jar (in openjre) has: com.sun.xml.internal.bind.v2.ContextFactory

I have tried adding the following which did not work:

  1. jaxb-api-2.1.jar to the lib.
  2. used openjdk instead of openjre

Why is the application not able to find the com.sun.xml.internal.bind.v2.ContextFactory class which is already present in rt.jar? Is there something else that I am missing? I tried searching, but all the answers are related to java 9 and above, but no answers fro openjre-8.

Error:

Caused by: 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 from [Module "deployment.myproject.war" from Service Module Loader]]
    at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:155)
    at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:141)
    at javax.xml.bind.ContextFinder.find(ContextFinder.java:314)
    at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:478)
    at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:435)
    at org.apache.camel.spring.handler.CamelNamespaceHandler.createJaxbContext(CamelNamespaceHandler.java:187)

RootCause: One of the jar in application's WebInf/lib had jaxb.properties which had following entry: javax.xml.bind.context.factory=com.sun.xml.internal.bind.v2.ContextFactory

Removing this resolved the issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM