[jboss-user] [EJB 3.0] - JNDI problem

cktheman do-not-reply at jboss.com
Tue Oct 3 17:30:41 EDT 2006

I have a problem in my very fist Hello World example.
I deployed a trivial Stateless Session Bean, here is the code of the bean and the test JSP:

package test;
import javax.ejb.*;
public interface UserRemote
  public int get();
package test;
import javax.ejb.*;
public class User
    implements UserRemote
  public int get()
    return 8;
<%@page import="java.util.*, test.*, javax.naming.*" %>

  InitialContext ctx = new InitialContext();
  out.println("" + ctx + "");
  out.println(ctx.lookup("User") + "");

The problem is that ctx.lookup returns a NamingContext and NOT an User (!!!). Here is the JSP output:

javax.naming.InitialContext at 453dd5
 org.jnp.interfaces.NamingContext at 1dea382

Where am I wrong?
thanks for any help

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

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

More information about the jboss-user mailing list