This discussion is archived
2 Replies Latest reply: Sep 12, 2012 8:52 AM by user696 RSS

Getting NameNotFoundException in EJB 3.0

961632 Newbie
Currently Being Moderated
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.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points