2 Replies Latest reply: Sep 12, 2012 10:52 AM by User696-Oracle RSS

    Getting NameNotFoundException in EJB 3.0

    961632
      Hi,

      I am getting NameNotFoundException while trying to look up the bean.

      My Business Interface :
      package test;

      import javax.ejb.Remote;

      @Remote
      public interface Test{
      String printName(String name);

      }

      Session Bean :

      @Stateless

      public class TestBean implements Test{

      //impl
      }

      Client:

      method(){
      .............
      Properties h;
                     Context ctx;

                     h = new Properties();
                     h.put(Context.INITIAL_CONTEXT_FACTORY,
                               "weblogic.jndi.WLInitialContextFactory");
                     h.put(Context.PROVIDER_URL,"t3://localhost:7001");
                     ctx = new InitialContext(h);

                     Test test = (Test) ctx
                               .lookup("TestBean#test.Test"); // Getting the exception here
                     
                     test.printName("name");
      }

      Please help me to resolve the issue.