NameNotFoundException: ejb local not found
harappa75 Jul 20, 2005 4:21 PMHi,
I have a session bean
MRManagerBean
and a few other beans.. in a mrejbs.jar when deploying I get
.jca:name=EtsDataSource,service=DataSourceBinding to JNDI name 'java:EtsDataSource'
[EjbModule] Deploying MarketingRequestItemShipments
[EjbModule] Deploying MarketingRequests
[EjbModule] Deploying MarketingRequestItems
[EjbModule] Deploying MRManager
[EJBDeployer] Deployed: file:/C:/jboss/server/default/deploy/mrejbs.jar
In ther JBoss console.
But when I try to use it in client class
InitialContext ic = new InitialContext();
Object ref = ic.lookup("java:comp/MRManagerLocal");
MRManagerLocalHome home = (MRManagerLocalHome) PortableRemoteObject.narrow(ref,MRManagerLocalHome.class);
MRManagerLocal localSession = home.create();
I get
12:57:57,124 INFO [STDOUT] javax.naming.NameNotFoundException: ejb not bound
12:57:57,124 INFO [STDOUT] at org.jnp.server.NamingServer.getBinding(NamingServer.java:491)
12:57:57,139 INFO [STDOUT] at org.jnp.server.NamingServer.getBinding(NamingServer.java:499)
12:57:57,139 INFO [STDOUT] at org.jnp.server.NamingServer.getObject(NamingServer.java:505)
12:57:57,139 INFO [STDOUT] at org.jnp.server.NamingServer.lookup(NamingServer.java:249)
12:57:57,139 INFO [STDOUT] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:610)
12:57:57,139 INFO [STDOUT] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
12:57:57,139 INFO [STDOUT] at javax.naming.InitialContext.lookup(InitialContext.java:347)
I have tried
Object ref = ic.lookup("MRManagerLocal");
Object ref = ic.lookup("ejb/MRManagerLocal");
Object ref = ic.lookup("java:comp/env/ejb/MRManagerLocal");
all with the same error.
My descriptors look like
JBoss.xml
<ejb-name>MRManager</ejb-name>
<local-jndi-name>MRManagerLocal</local-jndi-name>
<method-attributes>
</method-attributes>
ejb-jar.xml
[CDATA[]]
<ejb-name>MRManager</ejb-name>
<local-home>mr.massconnections.server.MRManagerLocalHome</local-home>
mr.massconnections.server.MRManagerLocal
<ejb-class>mr.massconnections.server.MRManagerSession</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
I am not sure what I am missing or where I am going wrong.. I looked at the Jndi list on the console and it says that the JNDI name is "MRManagerLocal"
Can anyone help me.
Regards
Rajesh J