users@glassfish.java.net

Re: Injection of ref to EJB fails

From: <glassfish_at_javadesktop.org>
Date: Thu, 22 Mar 2007 06:44:20 PST

Is there any particular reason you have some many separate ejb-jars? There's nothing wrong with it but it sounds like it's causing you more harm than good if in fact most of the ejbs are fairly tightly coupled and tend to be developed at the same time.

In any event, if you have multiple modules
within the same .ear the best way to share classes between them is to put .jars within the
/lib directory of the .ear. In that case you no longer have to do anything with the individual
MANIFEST Classpath entries in the ejb-jars themselves. That was an unfortunate and
very hard-to-use requirement of J2EE 1.4 and earlier releases.

You're correct that you can't put a .jar within an ejb-jar and expect that to make the classes
visible to other modules.

If you have multiple stand-alone modules or .ears, you're better off just replicating the
shared classes across them.

The only classes that must be packaged directly in the ejb-jar are the bean classes
themsevles. It's fine for the interfaces and value/helper classes to be in a library
.jar at the .ear level.
[Message sent by forum member 'ksak' (ksak)]

http://forums.java.net/jive/thread.jspa?messageID=209432