-
1. Re: Communication of Two EAR (or WAR) Files
burkaygur Sep 13, 2012 8:02 PM (in response to burkaygur)Any ideas?
I am trying to import objects from EAR1 into EAR2, so I can create new instances without duplicating code.
-
2. Re: Communication of Two EAR (or WAR) Files
wdfink Sep 14, 2012 3:35 AM (in response to burkaygur)Does this quickstart helps?
-
3. Re: Communication of Two EAR (or WAR) Files
burkaygur Sep 14, 2012 2:28 PM (in response to wdfink)I am looking through this quickstart to see if that is what I need. In the meantime, let me explain in more detail what I want to do:
I have two separate EAR files which I started as two seperate "ear-kitchensink" quickstarts:
EAR1 ----->
+ web
MemberController.java
VenueController.java
+ ejb
Member.java
Venue.java
EAR2 ----->+ web
MemberController.java
+ ejb
Member.java
Now, for EAR2 I would like to extend classes Venue.java and VenueController.java without having to copy all the code. Is that possible?
-
4. Re: Communication of Two EAR (or WAR) Files
wdfink Sep 17, 2012 4:23 AM (in response to burkaygur)AFAIK the only way to do so is to create a separate module and set a dependency for both EAR.
-
5. Re: Communication of Two EAR (or WAR) Files
burkaygur Sep 17, 2012 7:35 PM (in response to wdfink)Can you elaborate on that? I am fairly new to JBoss.
-
6. Re: Communication of Two EAR (or WAR) Files
wdfink Sep 18, 2012 2:11 AM (in response to burkaygur)You might have a look into the quickstart log4j (#44) which demonstrates how to add a reference to a module.
A module is one (or more) simple jar archive that is located in the JBOSS/modules directory. You might add archives you want as module and add references to applications that are need it.
See the datasource example, there is the JDBC drived added as module.
-
7. Re: Communication of Two EAR (or WAR) Files
burkaygur Sep 18, 2012 2:07 PM (in response to wdfink)How can I add a jar that is already in a deployment? Let me explain how I tried to do it. I have:
one-ear.ear
one-ejb.jar
two-ear.ear
two-ejb.jar
I placed a jboss-deployment-structure.xml into the top level of one-ear.ear META-INF and it is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
<deployment>
<dependencies>
<module name="deployment.two-ear.ear.two-ejb-0.0.1-SNAPSHOT.jar" />
</dependencies>
</deployment>
</jboss-deployment-structure>
However I am not sure it is actually importing classes from that jar, because when I try to import a class it does not work. Not sure what I am doing wrong.
-
8. Re: Communication of Two EAR (or WAR) Files
wdfink Sep 18, 2012 4:01 PM (in response to burkaygur)You can't set a dependency to a jar in a different deployment. You need to add the jar as a module and set a dependency for boh ear's