users@glassfish.java.net

Re: Moving from annotations to deployment descriptor - I'm desparate

From: <glassfish_at_javadesktop.org>
Date: Tue, 22 Apr 2008 07:10:36 PDT

> But various documents I came across led me to believe
> I'd need <ejb-link> when referencing a local session
> bean in an EJB module from a web module in the same
> EAR. What gives?

Hi Matt,

Some implementations are more lenient about the absence of ejb-link than others. It would be required if there were two EJB components within the app that exposed the ejb-local-ref's type.

>
> I've also seen examples that use <local-home/>. What
> does that mean?

The legacy 2.x programming model was based on a LocalHome/LocalComponent interface pair. The new 3.0 simplified API is based on only a local business interface. On the ejb-local-ref side, <local-home> is only used for the 2.x case and the associated local component interface goes in <local>. If the ejb-local-ref refers to a local business interface, only the <local> element is used.

>And why does deployment fail if I use
> <local> instead of <business-local> in ejb-jar.xml?

On the component definition side, <local> is only used in the 2.x case. A bean can expose multiple business interfaces, so unlike the ejb-ref/ejb-local-ref case, overloading the existing <local> element was not sufficient. As you point out, the inconsistency does cause some confusion.

We have some additional information on EJB dependencies in our EJB FAQ :

https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html#EJB_ejb-ref_ejb_local_ref

 --ken

>
> -Matt
[Message sent by forum member 'ksak' (ksak)]

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