1 Reply Latest reply on Oct 4, 2006 7:49 AM by Wolfgang Knauf

    JNDI problem

    Mario Arrigoni Neri Newbie

      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:


      Where am I wrong?
      thanks for any help