[jboss-user] [Management, JMX/JBoss] - Re: Invoke a SLSB from a MBean

toni do-not-reply at jboss.com
Wed Jan 31 16:19:27 EST 2007


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");




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

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



More information about the jboss-user mailing list