Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Local session bean call from a client in a different jar

 
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.
 
author & internet detective
Posts: 40200
816
Eclipse IDE VI Editor Java
  • 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.
 
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.
 
Maybe he went home and went to bed. And took this tiny ad with him:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic