|
Replies:
2
-
Last Post:
Oct 25, 2007 11:29 PM
by: remisb
|
|
|
|
|
|
|
How to access EJB bean from war application deployed as separate modules
Posted:
Oct 25, 2007 5:30 AM
|
|
|
Hi
I have developed an ejb session bean and deployed it in separate ejb.jar. I also have a web application which uses ejb session bean through Remote interface. When I'm deploying it as ear everything works without any problem.
Question is. How can I access ejb bean from war application without deploying ejb.jar and web.war together in one ear.
I would like to have 3-5 separate ejb.jar and 2 .war applications with access to ejb session beans from those separate ejb.jar's.
Any link to information, sample or suggestions are greatly welcomed. Thanks in advance Remis B.
|
|
|
|
|
|
|
|
|
Re: How to access EJB bean from war application deployed as separate module
Posted:
Oct 25, 2007 11:29 PM
in response to: ksak
|
|
|
Thanks for answer.
BTW I managed to find solution before receiving your responce. One thing that was causing problem is misunderstanding the difference between JNDI global and environment naming context. As I have noticed this part is least covered in EJB3 related books, articles and tutorials. All these sources are more focused on simple scenarios without paying enough attention to cases I have.
Solution I come with is by putting mappedName attribute in Stateless annotation on EJB. @Stateless(name="CountryBean", mappedName="ejb/Country")
also putting "ejb/" as prefix for mapped name automatically places it int "ejb/" jndi tree node in glassfish web admin's "Jndi tree browsing" window.
Also would like to pay attention in separating API classes from EJB implementation classes, and issues related with separate deployment of EJB, rar and war modules without putting them together in single ear. All samples I have red is leaving that question aside without bothering about covering this issue. Also there is not enough information about real deployment, updating, management strategies and issues.
If someone can provide links to information about issues listed above I'll be very thankful.
Regards Remis B
|
|
|
|
|