File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes separate webserver and application server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "separate webserver and application server " Watch "separate webserver and application server " New topic

separate webserver and application server

eswar kumar
Ranch Hand

Joined: Oct 20, 2002
Posts: 98
iam using webserver and application servers separatly what i have to write to communicate both the servlet and ejbs? can any one of you write the small code snippets for me pls..
thanks inadvance
Lasse Koskela

Joined: Jan 23, 2002
Posts: 11962
The only difference comes in the way you lookup your EJBs. Instead of

you need to lookup the context from the remote server as follows:

Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Kyle Brown
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
You need to be very precise here. There are two possibilities; either you separate the Web server(something like Apache or IIS) from the Application Server (which contains both the Web Container and EJB Container) or you can separate the Web Container from the EJB Container. Which do you really mean?
[ December 20, 2003: Message edited by: Kyle Brown ]

Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at for other WebSphere information.
Mark Lybarger
Ranch Hand

Joined: Dec 19, 2003
Posts: 72
i'd suspect as the other poster did that the application server == ejb (component) container, and web server == web container.
eswar kumar
Ranch Hand

Joined: Oct 20, 2002
Posts: 98
Actually tomcat (Servlet container) is running in one system and EJBs are running in another system which are physically separate systems
Reza Rahman
Ranch Hand

Joined: Feb 01, 2005
Posts: 580

In your particular scenario, I'd use Spring on Tomcat to inject the remote EJB (presumably EJB 3) instances. Look into Spring support for @EJB, @Resource and the <jee:jndi-lookup> element. Otherwise, you can have OpenEJB on Tomcat do the remote injection for you, but that is a little overkill in this case since all you really need is injection and not other EJB container services.

Hope it helps,

Independent Consultant — Author, EJB 3 in Action — Expert Group Member, Java EE 6 and EJB 3.1
I agree. Here's the link:
subject: separate webserver and application server
It's not a secret anymore!