Dom4J IllegalAccessError - Seam on JBoss 7 deployment error
bmaurer Jan 13, 2016 11:49 AMHi all,
I'm migrating a legacy application to Maven. There already have been many hitches and glitches, AFAIK Seam is really fickle concerning dependency versions it will work with.
This latest error I can't figure out. So I have an EAR with my (EJB) Jar, a War and the Seam.jar, plus lib/ folder. Now I actually have Dom4J as a dependency with scope=provided, since JBoss AS 7.1 provides version 1.6.1.
Just to reiterate, this application was running before, when built with the Ant build files. The Maven produced EAR won't deploy though. I have heard about similar errors (but not the exact same) with dependencies doubled in the classpath. I have checked (after removing it from lib/) and there should be none but the one in JBoss' modules.
Seam version is 2.3.1.Final on JBoss AS 7.1.1.Final, the Exception:
12:42:37,694 INFO [javax.servlet.ServletContextListener] (MSC service thread 1-6) Welcome to Seam 2.3.1.Final
12:42:38,745 INFO [org.jboss.seam.init.Initialization] (MSC service thread 1-6) reading /WEB-INF/components.xml
12:42:38,749 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/]] (MSC service thread 1-6) Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener: java.lang.IllegalAccessError: tried to access class org.dom4j.io.SAXHelper from class org.dom4j.io.SAXReader
at org.dom4j.io.SAXReader.createXMLReader(SAXReader.java:894) [dom4j-1.6.1.jar:1.6.1]
at org.dom4j.io.SAXReader.getXMLReader(SAXReader.java:715) [dom4j-1.6.1.jar:1.6.1]
at org.dom4j.io.SAXReader.read(SAXReader.java:435) [dom4j-1.6.1.jar:1.6.1]
at org.dom4j.io.SAXReader.read(SAXReader.java:343) [dom4j-1.6.1.jar:1.6.1]
at org.jboss.seam.util.XML.getRootElement(XML.java:24) [jboss-seam-2.3.1.Final.jar:2.3.1.Final]
at org.jboss.seam.init.Initialization.initComponentsFromXmlDocument(Initialization.java:227) [jboss-seam-2.3.1.Final.jar:2.3.1.Final]
at org.jboss.seam.init.Initialization.create(Initialization.java:133) [jboss-seam-2.3.1.Final.jar:2.3.1.Final]
at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:36) [jboss-seam-2.3.1.Final.jar:2.3.1.Final]
at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.13.Final.jar:]
at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_80]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_80]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_80]
Any ideas what it could be or how I could debug this? I've been stuck for 1-2 weeks now...