• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomcat and EJBs

 
Akhilesh Trivedi
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tomcat can not handle EJBS, but is there anything that stops them from supporting ejb clients?

Can I have a servlet/jsp on Tomcat and point it invoke an EJB method on an application server. Will I have to bundle other jars?
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18282
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Invoking an EJB from within a webapp is just an RMI call, so the same limitations apply for EJBs as do for other outward network connections - mainly that they're OK as long as the remote server responds in a reasonable period of time.

Since RMI is part of the core JRE, you shouldn't have to bundle in any extra library jars, although you will have to bundle in the remote interfaces for the EJBs themselves, just like always.
 
Tim Moores
Bartender
Posts: 2895
46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tomcat can handle EJBs via OpenEJB.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18282
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Moores wrote:Tomcat can handle EJBs via OpenEJB.


True, but the question wasn't whether Tomcat could perform as an EJB host, but whether Tomcat apps could contain EJB client code. And, as I said, the answer is "yes". You don't need OpenEJB or anything else to be an RMI client.
 
Tim Moores
Bartender
Posts: 2895
46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, but the post starts out with "Tomcat can not handle EJBS, ..." - mentioning options to do exactly that seems appropriate.
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Holloway wrote:

Since RMI is part of the core JRE, you shouldn't have to bundle in any extra library jars, although you will have to bundle in the remote interfaces for the EJBs themselves, just like always.


Since EJB invocations involve JNDI, I would expect the JNDI libraries containing the JNDI implementation classes of the application server, on which the EJBs are hosted, to be made available in the client application classpath (usually by packaging them within the application).
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18282
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jaikiran Pai wrote:
Tim Holloway wrote:

Since RMI is part of the core JRE, you shouldn't have to bundle in any extra library jars, although you will have to bundle in the remote interfaces for the EJBs themselves, just like always.


Since EJB invocations involve JNDI, I would expect the JNDI libraries containing the JNDI implementation classes of the application server, on which the EJBs are hosted, to be made available in the client application classpath (usually by packaging them within the application).


Not exactly. JNDI is the Java Naming and Directory Interface and the JNDI API is, like RMI, part of the base JVM class set. The JNDI server will serve up the EJB classes via the standard RMI mechanisms, so there's no need for additional jars for that side of the equation either.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic