This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
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
posted
0
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: 3879
posted
0
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.