users@glassfish.java.net

Re: How to reference a Local EJB from JSF ManagedBean

From: <glassfish_at_javadesktop.org>
Date: Tue, 18 Dec 2007 19:20:07 PST

>Do EJBs have
> to live in their own jar files or can they be located
> in the war's classes directory?
>

In JavaEE 5 or earlier, EJBs must be packaged inside a ejb-jar file, which can be deployed standalone, or as part of an EAR. There are proposals for the next version to be able to package ejb classes inside WAR.

> If they have to live in their own jar files are their
> standard practices for organizing projects? If you
> have a number of classes that implement a business
> model do you place them in their own jar and then the
> business logic in the ejb jars?

ejb-jar can reference library jars in its parent EAR library directory (by default EAR/lib/), or any other jars specified in ejb-jar's manifest.mf, or any other shared libraries installed in appserver. These library jars are good place for classes that may be shared by various ejb and non-ejb components.

-cheng

>
> I was hoping that for a simple project you could
> combine this, but if this is not the case then so be
> it. I am just hoping someone will have a more
> definitive answer as the books I am reading cover
> development pretty well, but have nill in the way of
> deployment information.
>
> Thanks again!
[Message sent by forum member 'cf126330' (cf126330)]

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