aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Are jars in EAR available Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Are jars in EAR available" Watch "Are jars in EAR available" New topic
Author

Are jars in EAR available

Bryon Phinney
Greenhorn

Joined: Aug 17, 2001
Posts: 13
If we put two separate bean jar files into one ear file are the classes in one jar on the classpath of the other?
Thanks for the help
Bryon
Marcos Maia
Ranch Hand

Joined: Jan 06, 2001
Posts: 977
I think so(but I�ve never tryied) as when you deploy a war file with a jar file in an ear file they do so. But I really can�t understand why you don�t package the ejbs in the same jar file as they are in the same ear.
regards.
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
    
    5
Originally posted by Marcos Maia:
I think so(but I�ve never tryied) as when you deploy a war file with a jar file in an ear file they do so. But I really can�t understand why you don�t package the ejbs in the same jar file as they are in the same ear.
regards.

The answer will depend on your application server, but possibly no. To force the classes in one EJB JAR file onto the classpath of the other, modify the CLASS-PATH line of the MANIFEST.MF file in the JAR file that wants to reference the other classes. For instance if I needed classes from JAR A.JAR in my JAR B.JAR I would have
CLASS-PATH: A.JAR
inside my B.JAR's manifest file. This is the "J2EE sanctioned" way of doing things and should work in all J2EE application servers.
BTW -- there are many good reasons not to package all of the EJB's in a single EAR in one JAR file. The simplest being that you only want to group "logically" related EJB's together into a JAR. If you have a reusable subsystem that should comprise its own JAR since it will probably change less often than the code that references it. That's just standard SCM procedures.

Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
 
wood burning stoves
 
subject: Are jars in EAR available