This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Tomcat and EJBs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat and EJBs" Watch "Tomcat and EJBs" New topic
Author

Tomcat and EJBs

Akhilesh Trivedi
Ranch Hand

Joined: Jun 22, 2005
Posts: 1576
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?


Keep Smiling Always — My life is smoother when running silent. -paul
[FAQs] [Certification Guides] [The Linux Documentation Project]
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16897
    
  26

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2409
Tomcat can handle EJBs via OpenEJB.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16897
    
  26

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
Rancher

Joined: Sep 21, 2011
Posts: 2409
Yes, but the post starts out with "Tomcat can not handle EJBS, ..." - mentioning options to do exactly that seems appropriate.
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10433
    
176

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).


[My Blog] [JavaRanch Journal]
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16897
    
  26

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tomcat and EJBs
 
jQuery in Action, 3rd edition