geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lucky lance <>
Subject How to lookup an EJB3 session bean by JNDI?
Date Fri, 08 Feb 2008 19:32:44 GMT
Hi all,
I deployed an  EJB3  stateless  session  bean  in geronimo 2.0.2.
Then I try to lookup it via the traditional JNDI.
The code
package foo;
public interface MyRemote{
    public String getMessage(); 

package foo;
public class MyBean implements MyRemote{
    public String getMessage(){
        return "hello world";

// The client
InitialContext ctx = new IntialContext();
Object obj = ctx.lookup("foo.MyBean");

It throws a NamingException.
I can not lookup either by the names like,

The question is how to write the correct jndi name?

Be smarter than spam. See how smart SpamGuard is at giving junk email the boot with the All-new
Yahoo! Mail  
View raw message