Skip to main content

@Local Bean Injection - How?

3 replies [Last post]
Anonymous

Hey,

I have a bunch of beans with both Local and Remote interfaces. We need at
least Remote interfaces, as our beans are queried from secondary servers,
though I would like to use Local references when accessing within the same
server instance.

I am hosting both a WAR and an EJB inside the same glassfish instance, but
doing the following gives me errors about not finding the bean.
@EJB MyBeanLocal myBean;

My session bean DEFINITELY implements both the @Local interfaces and @Remote
interface, and the MyBeanLocal is DEFINITELY the @Local. Doing the same but
replacing the Local with Remote works fine though.

--
Quintin Beukes
[att1.html]

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
ksak
Offline
Joined: 2005-05-20

The Local view is only available to web/EJB components within the same application. The easiest
thing would be to deploy your two modules within an .ear.

Q Beukes

But that is part of my problem.

Even inside the same EJB jar it doesn't work. I literally have 2 EJBs lie
next to each other in a package, and it doesn't work.

Quintin

On Mon, Aug 4, 2008 at 8:28 PM, wrote:

> The Local view is only available to web/EJB components within the same
> application. The easiest
> thing would be to deploy your two modules within an .ear.
> [Message sent by forum member 'ksak' (ksak)]
>
> http://forums.java.net/jive/thread.jspa?messageID=291394
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>
>

--
Quintin Beukes
[att1.html]

ksak
Offline
Joined: 2005-05-20

Can you post the actual error / stack trace you're seeing. Also please post the source code for the local interface and bean class, as well as the code containing the @EJB.