Hi all,
I am trying to call an EJB from a client that is itself deployed in same
server i.e Geronimo 2.2. But I am getting Exception.
The code to call EJB is:
try {
Context icontext=new InitialContext();
obj = icontext.lookup("ejbName");
......................
......................
}
.............
And I am getting exception as:
javax.naming.NameNotFoundException: ejbName
at
org.apache.xbean.naming.context.AbstractContext.lookup(AbstractContext.java:167)
at
org.apache.xbean.naming.context.AbstractContext.lookup(AbstractContext.java:605)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at
com.viithiisys.eadmin.security.EadminLoginModule.login(EadminLoginModule.java:123)
at
org.apache.geronimo.security.jaas.ClassOptionLoginModule.login(ClassOptionLoginModule.java:58)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
--
I have @Local and @Remote annotations in the EJB. And it works properly when
called from external client. I have tried iContext.lookup("ejb/beanrefname")
as well as all these:
lookup("local:/ejb/UserManagerImplLocal");
.lookup("java:/comp/env/ejb/UserManagerImplLocal");
Can anyone give me any idea how to accomplish this.?
How to lookup an EJB from client code that resides in same server.?
and all that...
Regards:
Sanjay Kumar
[email protected]
Java Developer