Jerwin Louise Uy wrote:Hi,
I will try to answer your questions the best as I can.
1. The default name of a session bean is the fully qualified class that it implements, i.e. SessionBean implements Foo.SomeRemoteInterface then that name attribute of SessionBean is bound to Foo.SomeRemoteInterface
2. mappedName bounds that session bean to a global variable in the RMI registry, but not all application server vendors are required to support this functionality
3. See #2 Assigning a mappedName may break portability across different application server vendors
4. See #1 - You can perform that following (assuming no ejb-jar.xml is used and default annotation values), then you can do the following
5. ejb-ref is that bound name for the session bean
For the purpose of SessionContext, you do not need to access this directly. If you really want to, the you can to modify the ejb-jar.xml to include the following information -
This deployment descriptor simply injects a session bean that implements the remote interface, bind to the the value of ejb-ref-name. Therefore, you can do the lookup on the SessionContext. I should note that the SessionContext is not aware of any global variables except for the ones declared in the ejb-jar.xml
I hope this information helps.
Thanks
alot Jerwin
i did get some of doubts cleared specially about mappedName,i had thought it will be good to for ejb to give mappedName and will make ejb universally accessible from any where,didn't know that it is not in J2EE SPEC .
but i had a reason to believe that let me tell you one scenario ,
one i was trying to look up an EJB from remote standalone
java POJO client and i kept getting the error of name not found till i gave the EJB mappedName.then it worked fine.
btw regarding SessionContext look up of EJB from EJB ,
i know that we don't need to do that we have many other ways but till i need to do it because its mentioned in Sun's EJB course FJ310 and hence i m required to show it practically to students.
i did read your post carefully and tried all you said but
still it didn't work
i m posting here the code of mini project that i have made
please have a look at the code and let me know if any mistake is there ..........
i have made this Enterprise Application in NetBeans 6.1 and Glassfish AS
code of calling Second EJB from First using SessionContext is as follows :
please let me know if any thing more can be done..........