users@glassfish.java.net

Re: [nbj2ee] Re: Help: access a Local Session Bean from another EAR

From: Steven Siebert <smsiebe_at_gmail.com>
Date: Fri, 15 Apr 2011 16:13:01 -0400

Nope. I believe Jason iis correct, as according to the EJB specification,
you must use the remote interface to access and EJB from another archive
(EAR, EJB, or WAR). This is for security reasons, because you may have both
a local and remote interface on a single EJB class, allowing you to specify
different interfaces for internal and external consumption. I'm curious as
to why the JNDI approach works - and wonder if this is actually a bug.
 There are several cases I would not like to expose my internal business
interface out to the world, but if it was simply available through JNDI from
another EAR running on the same domain. I think you might have found a bug
=)

Which version of GF are you running (3.0.1, 3.1)? I'm interested in testing
this, as it has security implications for me.

Thanks,

S

On Fri, Apr 15, 2011 at 3:24 PM, Xavier Callejas <
xavier_at_sistemasaereos.com.sv> wrote:

> On Vie 15 Abr 2011 12:58:49 Jason Lee escribió:
> > I don't think you can do that. The Local interface is only accessible
> > inside the same application (which is your .ear).
>
> I could access using lookup but the returned instance by the lookup is a
> runtime generated proxy class witch I can examine by reflection, it has the
> same methods that the local interface and witch I can also call, but this
> is
> kind odd way to use the local bean.
>
> Bu the weird thing is that I could lookup the local bean from another EAR,
> and, by reflection, use its methods. So I supposed that if this is
> thecnical
> possible maybe is there another "standard" way to do this.
>
>