geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lucky lance <luckylance2...@yahoo.ca>
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;
@Remote
public interface MyRemote{
    public String getMessage(); 
}

package foo;
@Stateless
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,
"MyBean",
"foo/MyBean",
"java:comp/foo.MyBean",
  "java:comp/env/foo.MyBean",
   "java:comp/foo/MyBean",
 "EJBModule/foo/MyBean/1.0/jar/SessionBeans/MyBean",
"EJBModule/foo/MyBean/1.0/jar/SessionBeans/foo.MyBean",
 "EJBModule/foo/MyBean/1.0/jar/SessionBeans/foo/MyBean",
  

The question is how to write the correct jndi name?
Thanks


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