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

Servlet as a Local Client ?

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
Can a servlet or a java application be a local client to a session/entity bean ? Or is it necessary that only an EJB can be a local client to another EJB ?
Thanks in advance.
Jughead
 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To my knowledge, everything residing in the same JVM than the bean can access the bean through local interfaces. Thus the answer is "yes".
 
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jughead
Servlets can be a local client but I dont think a Java application can be. Servlet can be as we can put ejb-reference in web.xml and use jndi-name to lookup the bean but in java application we can't do it...
Thanks
Maulin
 
Vijay Pawar
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Maulin,
I think you are right. If we create a ear file on Websphere or Weblogic, the ear file can contain web components (jsp and servlets) which i believe would be run in the same container.
But can we be sure that the server vendors would be having a common jvm for the ejb container and the web container or would it be different jvms?
By the way, maulin, do you know if an Indian Reprint of the most famous book on SCJP certification by "Kathy Sierra & Bert Bates" ( Publisher - Osborne) is available ?
Do we have a low cost Indian version of this book ?
Thanks a lot
Jughead
 
Ranch Hand
Posts: 1066
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Jughead:
But can we be sure that the server vendors would be having a common jvm for the ejb container and the web container or would it be different jvms?


That is an interesting question :roll:
By the way, maulin, do you know if an Indian Reprint of the most famous book on SCJP certification by "Kathy Sierra & Bert Bates" ( Publisher - Osborne) is available ?
- Yes, it is available. It is one of the best selling java books in India. Check out ur local computer shop.
 
Vijay Pawar
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Vish
 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jughead
Unfortunately, I didn't know answer for any of the two questions you asked latest Glad, that Vish could help.
I assured that we need to have ejb-ref specified, whether we want to use a bean from another bean or servlet. So a stand alone application having "public static void main" things can't really use the beans.
Now, I am not sure what would happen if we have two JVMs, one for ejbs and one for webapp, running on the same machine. I would expect that we are still able to work with local interfaces as far as we are on same machine but I am not sure. I am investigating this. I myself have many doubts but still not got a chance to perform enough tests....
Regards
Maulin
 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
by,

"public static void main" things can't really use the beans.

i mean using java:comp/env/ejb way applications can't...
 
Politics is a circus designed to distract you from what is really going on. So is this tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
    Bookmark Topic Watch Topic
  • New Topic