Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can servlet use local interface to call ejb

 
Elizabeth King
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can or how a servlet/JSP call an EJB using
local interfaces or directly to the bean class?
I think it is impossible
because servlets/JSPs are in web container
while EJBs are in EJB container. They are in
different JVMs. Someone
said weblogic6.1 uses classload to do the
work, but what about the transaction?
Please advise. Thanks.
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. As long as the Servlet/JSP is in the same JVM as the ejb, they can use Local Interfaces. Otherwise, Local Interfaces would be pointless.
 
Elizabeth King
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are WLS6.1's web container and ejb container
in same JVM?
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Mary King:
Are WLS6.1's web container and ejb container
in same JVM?

Yes. See the following link for a detailed description of classloading in WebLogic: Packaging WebLogic Server J2EE Applications.
 
Elizabeth King
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are no containers in Weblogic Servers,
logically and conceptually. Everything is
running in one application server within
one JVM. This is different from SUN's view
of application server.
Correct me if I'm wrong.
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Mary King:
There are no containers in Weblogic Servers,
logically and conceptually. Everything is
running in one application server within
one JVM. This is different from SUN's view
of application server.
Correct me if I'm wrong.

WebLogic does indeed have separate Web and EJB Containers. This allows BEA to license the Containers individually. Nothing in the J2EE specification even comes close to hinting that the Containers must run in separate JVMs. In fact, it does just the opposite with the idea of a EAR (Enterprise Application Resource). To comply with the specification an EAR must have the Web and EJB components residing in the same JVM to allow for Local calls between components.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic