[jboss-user] [EJB 3.0] - Re: Lookup EJB via JNDI

jaikiran do-not-reply at jboss.com
Thu Aug 28 01:36:45 EDT 2008


Post the code of your bean.

anonymous wrote : It doesn't work because of I need to specifiy application name here:
  | 
  | 
  |   | new InitialContext().lookup("MyApp/BeanLocal/local");
  |   | 	

That's the default JNDI name given to the bean. You can override it by using @RemoteBinding or @LocalBinding annotation on your bean. Here's an example:

import org.jboss.ejb3.annotation.LocalBinding;
import org.jboss.ejb3.annotation.RemoteBinding;

  | @Stateless
  | @LocalBinding (jndiBinding="MyUserManagerBeanLocal")
  | @RemoteBinding (jndiBinding = "MyUserManagerBeanRemote")
  | public class UserManagerBean implements UserManagerLocal, UserManagerRemote {
  | 

You can then use the MyUserManagerBeanLocal or MyUserManagerBeanRemote as the jndi name in the JNDI lookup.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4172946#4172946

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4172946



More information about the jboss-user mailing list