1 Reply Latest reply on Oct 12, 2006 2:44 AM by jaikiran pai

    Looking up ejb on jboss 4.0

    Joshua Jackson Master

      Dear all,

      How do I lookup for an EJB on Jboss 4.0?

      This is the code I write:

      InitialContext ctx=new InitialContext();
       Context ref=(Context)ctx.lookup("java:comp/env/ejb");
       DepartmentHome home=(DepartmentHome)ref.lookup("DepartmentHome");
       Department ejb=home.create();

      This is my JNDI_NAME and COMP_NAME:
      public static final String COMP_NAME="java:comp/env/ejb/Department";
      public static final String JNDI_NAME="Department";

      Thanks in advance.