I am using Eclipse+WAS 7 to develop my application. I have an EAR, which has a web application module and an EJB module.
I am able to access my EJB methods using the below client code. This code is from my web application.
My Client to access EJB methods:
I learned that I am accessing the default JNDI name of the EJB.
Could someone please let me know how/where I can customize the JNDI names to access the EJB bean methods so that I can access the bean methods using
ctx.lookup("xx/yyl"); instead of ctx.lookup("ejblocal:a.b.ie.StateLessBeanLocal");
Hi Kevin - Thank you for the response. However, I am looking for the name change as James Suggested.
James - Thanks a lot for your response. I tried out your suggestion. However, I get NameNotFoundException.
StateLessBeanLocal local = (StateLessBeanLocal) ctx.lookup("foo"); in my client code and
@Stateless(name = "foo", mappedName="foo") in my Bean class
Please let me know if I am missing anything here.
K Kiran Kumar
Joined: Jan 04, 2006
I found the solution. Search for the file ibm-ejb-jar-bnd.xml (should be in ejbModule/META-INF/). Keep an entry in the file.
<session name="xxxServiceClass" simple-binding-name="ejb/abcd">
<resource-ref name="datasources" binding-name="datasource JNDI name"/> <! This is not mandatory-->