Reputation: 1114
I am new to Wildfly and wanted to upgrade our current JBoss 5.1 server to Wildfly 8.1. I have an application that contains 1 war and many jars which are on the class path for that war. This ear deploys on JBoss 5.1 with no issue but on Wildfly 8.1 I get LinkageErrors.
2014-10-09 16:08:12,425 WARN [org.jboss.modules] (MSC service thread 1-16) Failed to define class org.castor.xml.XMLProperties in Module "deployment.iffc.ear.castor-1.3.3-xml.jar:main" from Service Module Loader: java.lang.LinkageError: Failed to link org/castor/xml/XMLProperties (Module "deployment.iffc.ear.castor-1.3.3-xml.jar:main" from Service Module Loader)
...
Caused by: java.lang.ClassNotFoundException: org.castor.core.util.AbstractProperties from [Module "deployment.iffc.ear.castor-1.3.3-xml.jar:main" from Service Module Loader]
The application uses castor 1.3.3 and on the classpath for the war these are included: castor-1.3.3-core.jar and castor-1.3.3-xml.jar.
The directory structure of the ear is like this:
ear
|---METAINF
|---castor-1.3.3-core.jar
|---castor-1.3.3-xml.jar
|---many other jars
|---warFile.war
The ClassNotFoundException pointing to org.castor.core.util.AbstractProperties DOES EXIST but in castor-1.3.3-core.jar. How come the code does not look in the core jar file instead of the xml jar file?
I've learned with Wildfly that the classloading has changed. There's a section title "EAR Class Loading".
The only subdeployment in this ear, though, is the warFile.war. The others don't show up as subdeployments unless I'm interpreting the docs wrong. It states that wars and EJB jars are subdeployments and I do not have EJB jars.
In anycase, I did try explicitly setting ear-subdeployments-isolated to false by creating a jboss-deployment-structure.xml file in the ear's METAINF directory. That didn't do anything.
I also explicitly modified the manifest file of castor-1.3.3-xml.jar to have a dependency on castor-1.3.3-core.xml but that caused a whole other mess. This resulted in all the other jars missing dependencies on other jars... I guess if you explicitly state a dependency on one jar you have to do it to all?
Any help is much appreciated. Would like to get this app running on this new server. Thanks!
UPDATE:
The warFile.war has the Class-Path defined in its MANIFEST.MF file with all those jars located at the ear root level.
Added the class path from the war module:
Class-Path: axis-1.3.jar castor-1.3.1-core.jar castor-1.3.1-xml.jar co
mmons-jxpath-1.2.jar commons-lang-2.0.jar commons-logging.jar commons
-pool-1.3.jar log4j-1.2.14.jar gson-2.2.4.jar activation.jar axiom-ap
i.jar axiom-impl.jar axis2-adb.jar axis2-kernel.jar backport-util-con
current.jar commons-codec.jar commons-discovery.jar commons-fileuploa
d.jar commons-httpclient.jar commons-io.jar geronimo-strax-api_1.0_sp
ec.jar neethi.jar qxpsm-webservicestubs-10.1.jar wsdl4j.jar wstx-asl.
jar XmlSchema.jar
Upvotes: 0
Views: 4296
Reputation: 26
You have to put non ejb or war modules into a lib folder in the ear file
ear
|---lib
| |---castor-1.3.3-core.jar
| |---castor-1.3.3-xml.jar
| |---non ejb jars
|
|-- warFile.war
|-- ejbFile.jar
Upvotes: 1