Hi -

Yes, the lookup from the IC works.  I am using the following JNDI format:
{ejbClass.simpleName}/{interfaceType.annotationName}

Note that if I simply move the bean I am trying to inject into the same eclipse 
project as the bean doing the injection, everything works fine.  This problem 
only occurs when the bean I am trying to inject  is in a different project.

Thanks.

-greg

-----Original Message-----
From: Quintin Beukes [mailto:[email protected]] 
Sent: Wednesday, October 21, 2009 3:31 AM
To: [email protected]
Subject: Re: EJB injection does not seem to work when using mapped name 
annotation attribute

Inside the bean you're trying to inject, does the following code
return an object:

new InitialContext().lookup("FooImpl/Local") ?

Is the "Foo" EJB mapped to FooImpl/Local and how? If not, are you
using a JNDI format to define the above bean-class/interface format?

Quintin Beukes



On Wed, Oct 21, 2009 at 12:49 AM, Totsline, Greg <[email protected]> wrote:
> Hi -
>
> When using OpenEJB3.1 and 3.1.1 we are noticing that when we use the 
> 'mappedName' attribute of the @EJB annotation, OpenEJB does not seem to 
> successfully inject the EJB.  For example:
>
> @EJB(mappedName="FooImpl/Local")
> Foo myInjectedFoo;              // does not work, always null
>
> @EJB
> Foo myOtherInjectedFoo; // works
>
> We noticed that the mappedName problem only occurs when the injected bean is 
> used by a outside it's own Eclipse project (i.e. Project A injects Foo into 
> one of its SLSBs, but Foo is defined in Project B).
>
> Can someone help or suggest a work around?
>
> Many Thanks.
>
> -greg
>
>
>
>

Reply via email to