IllegalAccessError: tried to access class... ClassCastException when migrating ear containing wars that use MANIFEST.MF Class-Path to JBoss EAP 6.3 from an earlier version of JBoss EAP
Issue
- We are seeing an IllegalAccessError related to a JAXB call when migrating our EAR application from JBoss EAP 6.0.1 to JBoss EAP 6.3. The EAR contains some jaxb jars in ear/lib and also contains some WAR files which use MANIFEST.MF Class-Path: to include some utility jars in the root of the ear on the WAR's classpath. The utility jars are not in the application.xml as they are not sub deployments, they are just utility jars used by the WAR sub deployments.
ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/jaxb-example-servlet]] (ServerService Thread Pool -- 53) JBWEB000289: Servlet servlet threw load() exception: java.lang.IllegalAccessError: tried to access class javax.xml.bind.ContextFinder from class javax.xml.bind.JAXBContext
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:652) [jboss-jaxb-api_2.2_spec-1.0.4.Final-redhat-2.jar:1.0.4.Final-redhat-2]
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:599) [jboss-jaxb-api_2.2_spec-1.0.4.Final-redhat-2.jar:1.0.4.Final-redhat-2]
at com.jboss.examples.servlet.Servlet.marshall(Servlet.java:41) [servlet-fun.jar:]
at com.jboss.examples.servlet.Servlet.init(Servlet.java:28) [servlet-fun.jar:]
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1194) [jbossweb-7.4.8.Final-redhat-4.jar:7.4.8.Final-redhat-4]
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1100) [jbossweb-7.4.8.Final-redhat-4.jar:7.4.8.Final-redhat-4]
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3591) [jbossweb-7.4.8.Final-redhat-4.jar:7.4.8.Final-redhat-4]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3798) [jbossweb-7.4.8.Final-redhat-4.jar:7.4.8.Final-redhat-4]
at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:161) [jboss-as-web-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]
at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:59) [jboss-as-web-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]
at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:94) [jboss-as-web-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_51]
at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_51]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_51]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_51]
at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_51]
at org.jboss.threads.JBossThread.run(JBossThread.java:122)
Environment
Red Hat JBoss Enterprise Application Platform (EAP) 6.3.0
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.