-
1. Re: Deployment of simple JAR in EAR
jaikiran Feb 9, 2012 10:12 PM (in response to andhess)If your myjar.jar contains just the bean interfaces then it should be placed in the .ear/lib folder along with the other libraries.
P.S: I guess the packaging structure you posted has a typo - the lib folder should be at the root of the .ear and not in the META-INF of the .ear
-
2. Re: Deployment of simple JAR in EAR
andhess Feb 10, 2012 2:09 PM (in response to jaikiran)Hi
1. You are right! The lib directory is in the root of the EAR and NOT in META-INF.
2. The myjar.jar has more than just the bean interfaces. The position inside the EAR is not in question as this is a development policy from the project owner. It also works fine this way for AS5 or AS6.
The "AS7 class loading" description says something like: "The EAR/lib is one module; each EJB-JAR and WAR is a separate module with assess to the EAR/lib".
The myjar.jar library in the root of the EAR is also a module in the class loader (deployment.myear.ear.myjar.jar), but is has no access to the EAR/lib module.
How can I define this dependency ?
-
3. Re: Deployment of simple JAR in EAR
jaikiran Feb 10, 2012 10:36 PM (in response to andhess)1 of 1 people found this helpfulAndreas Hess wrote:
2. The myjar.jar has more than just the bean interfaces.
What other things does it contain? Any components like EJBs?
Andreas Hess wrote:
The myjar.jar library in the root of the EAR is also a module in the class loader (deployment.myear.ear.myjar.jar), but is has no access to the EAR/lib module.
If that myjar.jar doesn't contain any components then it will not be treated as a subdeployment. The EE spec says that plain library jar files should be packaged in the library directory which by default is .ear/lib folder.
-
4. Re: Deployment of simple JAR in EAR
andhess Feb 13, 2012 3:26 PM (in response to jaikiran)jaikiran pai schrieb:
What other things does it contain? Any components like EJBs?
It contains normal JAVA classes (POJO). No J2EE!
jaikiran pai schrieb:
If that myjar.jar doesn't contain any components then it will not be treated as a subdeployment. The EE spec says that plain library jar files should be packaged in the library directory which by default is .ear/lib folder.
Here is the answer. No J2EE! It looks like a subdeployment, but it has no access to ear/lib. I converted the JAR into an EJB-JAR.
It only confused me that AS5/AS6 did a full EJB-JAR like deployment on a simple JAR.
Workaround is in place. Problem solved. Thanks!