users@glassfish.java.net

Re: Looking up a stateless session bean from a POJO in the Web tier

From: Sahoo <sahoo_at_sun.com>
Date: Fri, 09 May 2008 13:40:21 +0530

Please refer to the GlassFish EJB FAQ.

Sahoo

glassfish_at_javadesktop.org wrote:
> Hi,
>
> How can I lookup an EJB3 stateless session bean in the Web tier inside a POJO class without using injection?
>
> The following code fails:
>
> UserManager userManager = (UserManager) ctx.lookup("java:comp/env/BeanName");
>
> where BeanName is the name assigned to the session bean via the @Stateless annotation.
>
> Also this doesn't work:
>
> UserManager userManager = (UserManager) ctx.lookup(UserManager.class.getName());
>
> Thanks in advance,
> Behrang
> [Message sent by forum member 'behrangsa' (behrangsa)]
>
> http://forums.java.net/jive/thread.jspa?messageID=273462
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>