users@glassfish.java.net

Re: How to access local interface from MDB?

From: <glassfish_at_javadesktop.org>
Date: Wed, 10 Dec 2008 11:51:24 PST

> Thanks very much. A few clarifications:
>
> 1. What exactly do you mean by "the same
> application"? The same EAR file?

Yes, or in the case of a stand-alone ejb-jar only other
components in the same jar.

> 2. @EJB isn't an option as the MDB will have no idea
> what the target session beans are when it is
> written.
>
> So, putting everything together, I think I would have
> to:
> a) Package the MDB and the target EJB(s) into 1 EAR
> file.
> b) Write an ejb-jar.xml file for this EAR, listing
> each referenced EJB in the MDB's descriptor, like
> below.

yes, looks good. If you switch to the EJB 3.0 Local Business
view, the <local-home> element is not specified.

BTW, we're planning to address this lookup issue in EJB 3.1. We'll
be defining standard portable global JNDI names that apply to the
Local view. It won't change the same-app restriction, but it will mean
you won't have to define the ejb-local-ref dependencies a-priori. See
my blog for more details :

http://blogs.sun.com/kensaks/entry/portable_global_jndi_names
[Message sent by forum member 'ksak' (ksak)]

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