This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes Servlet Clients For EJB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Servlet Clients For EJB" Watch "Servlet Clients For EJB" New topic

Servlet Clients For EJB

Shan Karawita
Ranch Hand

Joined: Oct 13, 2000
Posts: 83
Hi Everyone,

I'm implementing a Discussion Forum application for my company intranet.I'm having EJB for the Business tear & servlets as clients( 10 - 15 servlets).I deployed all the EJB's (stateless session beans) in J2EE server & they work fine.But I'm struggling to access them from the servlets (they cannot talk to the EJB via the JNDI name).I don't want to deploy the servlets in the J2EE server.What I want is to deploy the servlet in another box on tomcat.Please let me know the procedures I should follow.
Thanks in advance.

Shan Karawita.
Vivek Viswanathan
Ranch Hand

Joined: Mar 03, 2001
Posts: 350

If you can give me some more details about the kind of error that you get???
I have implemented exactly the same thing.
Weblogic Appserver : EJB - mainly Stateless Session Beans and helper Java Beans
Tomcat : JSP Pages and Client Side Java Beans
Apache : Web Server that forwards JSP and Servlet request to Tomcat
I have arranged Tomcat and Apache on the same machine

Vivek Viswanathan SCJP 1.2, SCJP 1.6,SCJD,SCEA,SCWCD,IBM-484,IBM-486,IBM-141,Ms.NET C# 70-316,SCMAD, LPIC-I
Frank Carver

Joined: Jan 07, 1999
Posts: 6920
The important thing is that they need to be using the same JNDI context. Make sure that both the EJB container and the Servlet container are configured to use the same JNDI repository, the the servlet container should be able to locate and invoke any beans it needs.

Read about me at ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
Shan Karawita
Ranch Hand

Joined: Oct 13, 2000
Posts: 83
Thank you so much for your responses , Vevek & Frank .Sorry I'm not arround yesterday b'cos I was bit bussy with my project.
Frank , at the moment I'm using the Servletrunner as a servlet container( Hope to use topcat later ).So in this case how could I make sure that the servletrunner configured to use the same JNDI repository ( Do I have to code the client servlets with any specific way to find the Host & the EJB's ?) .I was struggling to find any documentations regarding this.If you could give me a example for it I would be so please.
Thanks in advance ,
Shan Karawita
I agree. Here's the link:
subject: Servlet Clients For EJB
It's not a secret anymore!