This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I think you havent gone throught the basic tutorials of EJB. Well, yes you can call local/remote interface from webmodule. But how you want to do it totally depends on EJB version you are using.. If you are using EJB 2.x then you need to define the mapping of EJB modules in web.xml(then you need to work with the home/local-home interface and then you need to get remote/local interface....) and if you are using EJB 3.0 then by getting context of interface you can call service methods of it( and here you dont even have to call home interface !!!).
Do let me know if i can assist you in more effecient way....
Cheers !!! Sumit Malik
If at first you don't succeed, don't try skydiving
Joined: Jun 27, 2006
Thanks for the response.
I am using EJB2.0. The thing i want to know whether is it possible to call a Session bean implemented as local view in EJB module from WEB module. Since both have different containers, is it required that we need to make remote call ?
Joined: Jan 05, 2007
Hey Gokul I m not very much conversant with EJB2.x series and I have just come across with EJB 3.0 but let me see if i can assist you..
If you have packaged your application with all you ejb jar's and all web modules in a single ear file and you are using EJB2.x series then you need to get the context localhome interface. Through this interface you need to call create method which would return you local interface(actually stub/implementation of bean class).
Once you get local interface(or stub) you can call implemented business method(of interface) of bean through interface(local)...
I hope you must have got the clue that can you call local interface or not..... So with EJB 2.x you need to call home/localhome interface and not remote/local interface directly......