on 10-26-2010 9:42 PM
Hi,
I'm getting the same naming exception you can see @ http://www.coderanch.com/t/51509/Struts/Calling-EJB-action-class when looking up an ejb object.
How should I lookup the object?
Thank you in advance,
Michael Jones
Hello
Please try the following.
Do annotate the EJB with the corresponding name in order to identify it later on:
@Stateful(name = "MyLostEJB")
public MyLostEJB implements LostEJBRemoteHome, LostEJBLocalHome
{
public String sayHello(){ return "Hello"; }
}
And then:
LostEJBRemoteHome myEjb= null;
myEjb= (LostEJBRemoteHome ) new InitialContext().lookup("MyLostEJB/remote");
myEjb.sayHello();
I hope it helps
Alejandro
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.