Hi,
did you define the class-path in the MANIFEST.MF of EJB-Main.jar like this?
Class-Path: EJB-MainClient.jar
If this does not work, you could move the EJB-MainClient.jar to a lib/ folder in your ear, so that you would have this layout:
EJB-MainEAR.ear
JPA-Main.jar (JPA Project)
EJB-Main.jar (EJB Session Beans Project)
GWT-Main.war (Web Project)
lib/
EJB-MainClient.jar (EJB Interfaces Project)
JEE5 defines that jars inside the lib/ folder have to be included in the class path for the contained modules.
Imho this would be the best way anyway to distinguish modules from utility jars.
Kind regards,
Robert
From: jboss-as7-dev-bounces@lists.jboss.org [mailto:jboss-as7-dev-bounces@lists.jboss.org] On Behalf Of Diego Keller Silva
Sent: Tuesday, November 08, 2011 1:54 PM
To: jboss-as7-dev@lists.jboss.org
Subject: [jboss-as7-dev] Classpath problems in EAR project
Hi!
I am migrating a project from JAS 6 Final to JAS 7.0.2 Final.
Here is the structure of my application:
EJB-MainEAR.ear
JPA-Main.jar (JPA Project)
EJB-MainClient.jar (EJB Interfaces Project)
EJB-Main.jar (EJB Session Beans Project)
GWT-Main.war (Web Project)
I read the article https://docs.jboss.org/author/display/AS7/Class+Loading+in+AS7 and i am aware of the property ear-subdeployments-isolated.
I tried to add this property to the file C:\jboss7\standalone\configuration\standalone.xml setting it to FALSE.
<subsystem xmlns="urn:jboss:domain:ee:1.0">
<ear-subdeployments-isolated>false</ear-subdeployments-isolated>
</subsystem>
But i get this error message whe starting JBoss.
"SistemaSession" is the EJB interface inside EJB-MainClient.jar.
10:39:03,356 WARN [org.jboss.modules] (MSC service thread 1-4) Failed to define class com.framework.business.ejb.session.SistemaSessionBean in Module "deployment.EJB-MainEAR.ear.EJB-Main.jar:main" from Service Module Loader: java.lang.LinkageError: Failed to link com/framework/business/ejb/session/SistemaSessionBean (Module "deployment.EJB-MainEAR.ear.EJB-Main.jar:main" from Service Module Loader)
at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:401) [jboss-modules.jar:1.0.2.GA]
at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:261) [jboss-modules.jar:1.0.2.GA]
at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:76) [jboss-modules.jar:1.0.2.GA]
at org.jboss.modules.Module.loadModuleClass(Module.java:590) [jboss-modules.jar:1.0.2.GA]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:183) [jboss-modules.jar:1.0.2.GA]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:361) [jboss-modules.jar:1.0.2.GA]
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:310) [jboss-modules.jar:1.0.2.GA]
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:103) [jboss-modules.jar:1.0.2.GA]
at org.jboss.as.ejb3.deployment.processors.BusinessViewAnnotationProcessor.getEjbClass(BusinessViewAnnotationProcessor.java:201)
at org.jboss.as.ejb3.deployment.processors.BusinessViewAnnotationProcessor.deploy(BusinessViewAnnotationProcessor.java:83)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115) [jboss-as-server-7.0.2.Final.jar:7.0.2.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [:1.7.0_01]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [:1.7.0_01]
at java.lang.Thread.run(Thread.java:722) [:1.7.0_01]
Caused by: java.lang.NoClassDefFoundError: com/framework/business/client/intf/SistemaSession
at java.lang.ClassLoader.defineClass1(Native Method) [:1.7.0_01]
at java.lang.ClassLoader.defineClass(ClassLoader.java:791) [:1.7.0_01]
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) [:1.7.0_01]
at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:397) [jboss-modules.jar:1.0.2.GA]
... 15 more
Caused by: java.lang.ClassNotFoundException: com.framework.business.client.intf.SistemaSession from [Module "deployment.EJB-MainEAR.ear.EJB-Main.jar:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:191) [jboss-modules.jar:1.0.2.GA]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:361) [jboss-modules.jar:1.0.2.GA]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:333) [jboss-modules.jar:1.0.2.GA]
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:310) [jboss-modules.jar:1.0.2.GA]
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:103) [jboss-modules.jar:1.0.2.GA]
... 19 more
Then i tried to add a jboss-deployment-structure.xml file to the EAR, defining all the dependencies.
<jboss-deployment-structure>
<ear-subdeployments-isolated>false</ear-subdeployments-isolated>
<deployment>
<dependencies>
<module name="com.keyworks.k3" />
</dependencies>
</deployment>
<sub-deployment name="JPA-Main.jar">
</sub-deployment>
<sub-deployment name="EJB-MainClient.jar">
<dependencies>
<module name="deployment.EJB-MainEAR.ear.JPA-Main.jar:main" />
</dependencies>
</sub-deployment>
<sub-deployment name="EJB-Main.jar">
<dependencies>
<module name="deployment.EJB-MainEAR.ear.JPA-Main.jar:main" />
<module name="deployment.EJB-MainEAR.ear.EJB-MainClient.jar:main" />
</dependencies>
</sub-deployment>
<sub-deployment name="GWT-Main.war">
<dependencies>
<module name="deployment.EJB-MainEAR.ear.JPA-Main.jar:main" />
<module name="deployment.EJB-MainEAR.ear.EJB-MainClient.jar:main" />
</dependencies>
</sub-deployment>
</jboss-deployment-structure>
And the error message when starting JBoss was:
10:43:37,194 INFO [org.jboss.as.server.controller] (DeploymentScanner-threads - 2) Deployment of "EJB-MainEAR.ear" was rolled back with failure message {"Services with missing/unavailable dependencies" => ["jboss.deployment.subunit.\"EJB-MainEAR.ear\".\"GWT-Website.war\".CONFIGURE_MODULE missing [ jboss.module.information.service.\"deployment.EJB-MainEAR.ear.JPA-Main.jar:main\".main, jboss.module.information.service.\"deployment.EJB-MainEAR.ear.EJB-MainClient.jar:main\".main ]","jboss.deployment.subunit.\"EJB-MainEAR.ear\".\"EJB-Main.jar\".CONFIGURE_MODULE missing [ jboss.module.information.service.\"deployment.EJB-MainEAR.ear.JPA-Main.jar:main\".main, jboss.module.information.service.\"deployment.EJB-MainEAR.ear.EJB-MainClient.jar:main\".main ]","jboss.deployment.subunit.\"EJB-MainEAR.ear\".\"JPA-Main.jar\".POST_MODULE missing [ jboss.module.spec.service.\"deployment.EJB-MainEAR.ear.EJB-MainClient.jar\".main, jboss.module.spec.service.\"deployment.EJB-MainEAR.ear.EJB-Main.jar\".main ]","jboss.module.service.\"deployment.EJB-MainEAR.ear\".main missing [ jboss.module.spec.service.\"deployment.EJB-MainEAR.ear.EJB-MainClient.jar\".main, jboss.module.spec.service.\"deployment.EJB-MainEAR.ear.EJB-Main.jar\".main ]","jboss.deployment.subunit.\"EJB-MainEAR.ear\".\"EJB-MainClient.jar\".CONFIGURE_MODULE missing [ jboss.module.information.service.\"deployment.EJB-MainEAR.ear.JPA-Main.jar:main\".main ]","jboss.deployment.subunit.\"EJB-MainEAR.ear\".\"TST-Main.war\".CONFIGURE_MODULE missing [ jboss.module.information.service.\"deployment.EJB-MainEAR.ear.JPA-Main.jar:main\".main, jboss.module.information.service.\"deployment.EJB-MainEAR.ear.EJB-MainClient.jar:main\".main ]","jboss.deployment.unit.\"EJB-MainEAR.ear\".POST_MODULE missing [ jboss.module.spec.service.\"deployment.EJB-MainEAR.ear.GWT-Website.war\".main, jboss.module.spec.service.\"deployment.EJB-MainEAR.ear.EJB-MainClient.jar\".main, jboss.module.spec.service.\"deployment.EJB-MainEAR.ear.EJB-Main.jar\".main, jboss.module.spec.service.\"deployment.EJB-MainEAR.ear.TST-Main.war\".main, jboss.module.spec.service.\"deployment.EJB-MainEAR.ear.GWT-Main.war\".main ]","jboss.deployment.subunit.\"EJB-MainEAR.ear\".\"GWT-Main.war\".CONFIGURE_MODULE missing [ jboss.module.information.service.\"deployment.EJB-MainEAR.ear.JPA-Main.jar:main\".main, jboss.module.information.service.\"deployment.EJB-MainEAR.ear.EJB-MainClient.jar:main\".main ]","jboss.module.service.\"deployment.EJB-MainEAR.ear.JPA-Main.jar\".main missing [ jboss.module.spec.service.\"deployment.EJB-MainEAR.ear.EJB-MainClient.jar\".main, jboss.module.spec.service.\"deployment.EJB-MainEAR.ear.EJB-Main.jar\".main ]"]}
What i need to do for my modules (JAR and WAR) to see each other and get this working?
Diego Keller
diego.keller@keyworks.com.br
(54) 3534-8980
http://www.keyworks.com.br
Keyworks TI ® - Tailor Made Software
WINCOR NIXDORF International GmbH
Sitz der Gesellschaft: Paderborn
Registergericht Paderborn HRB 3507
Geschäftsführer: Eckard Heidloff (Vorsitzender), Stefan Auerbach, Dr. Jürgen Wunram
Vorsitzender des Aufsichtsrats: Karl-Heinz Stiller
Steuernummer: 339/5884/0020 - Ust-ID Nr.: DE812927716 - WEEE-Reg.-Nr. DE44477193
Diese E-Mail enthält vertrauliche Informationen.
Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben,
informieren Sie bitte sofort den Absender und vernichten Sie diese E-Mail.
Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser E-Mail ist nicht gestattet.
This e-mail may contain confidential information.
If you are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail.
Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden.