This week's book giveaway is in the HTML/CSS/JavaScript forum.
We're giving away four copies of Practical SVG and have Chris Coyier on-line!
See this thread for details.
Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Local session bean call from a client in a different jar

 
Taariq San
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a client packaged and deployed seperately from the web or business tier but as a shared library and is in the same JVM as the EJB.
Is it possible to make a local call to the EJB as you would from a servlet?
For servlets you have to configure the web.xml, how would one do it from this jar?

Remote call would be too much serialization/deserialization, I'll consider a RESTful web service as well.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35753
412
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you say it is in the same JVM as the EJB, do you mean it is called from the EJB? If so, you can make a local call. If not, you cannot make a call.

A web service is a type of remote call. I don't follow what this would save you.
 
Jerwin Louise Uy
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is possible to make a local call to a local EJB as long as the calling servlet is within the application scope, i.e. packaged in the same EAR.

The overhead of RMI is a trade off given the power of invoking method calls remotely. However, it is a question of your requirement need. If your application does not in any way need remote calls, then RMI in the same JVM is redundant.
 
Taariq San
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the input.

Originally posted by Jeanne Boyarsky:
When you say it is in the same JVM as the EJB, do you mean it is called from the EJB? If so, you can make a local call. If not, you cannot make a call.


Its a custom login module, in a shared library.


A web service is a type of remote call. I don't follow what this would save you.

If it has to be remote, and some remote calls are faster than others...
I'm not suggesting REST is quicker, it has similar + different costs.

I'll make a remote ejb call for the moment as time is short and the todo list longer.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!