This content has been marked as final.
Show 2 replies
-
1. Re: Invoke a SLSB from a MBean
peterj Jan 31, 2007 11:40 AM (in response to toni)The same as from any other client, via JNDI.
-
2. Re: Invoke a SLSB from a MBean
toni Jan 31, 2007 4:19 PM (in response to toni)Well, that's pretty obvious but I was wondering about the naming convention. Here is the code and naming convention:
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
p.put(Context.PROVIDER_URL, "localhost:1099");
context = new InitialContext(p);
Object object = context.lookup("/applicationNameOfEarWithoutExtension/NameOfSessionBeanInNameAnnotation/local");
So if you work with Seam and deploy a ear called "myapp.ear" and tag a bean with @Name("testSessionBean"), the you need to call:
Object object = context.lookup("/myapp/testSessionBean/local");