File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes BEA/Weblogic and the fly likes Deploy EJB and Web separately Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Deploy EJB and Web separately" Watch "Deploy EJB and Web separately" New topic

Deploy EJB and Web separately

Alexander Yanuar Koentjara
Ranch Hand

Joined: Jun 03, 2002
Posts: 31
Hi ..
If I have 3 machines, machine I is a managed server, dedicated for application server (EJBs). Machine II is a managed server, dedicated for web applications (the war file). Machine III is an admin server. All run under 1 domain.
What I do now:
1. I start machine III as admin server.
2. I deploy the EJB components at machine I
3. I deploy the Web components at machine II (which contains only web application war) at machine II
I browse the JNDI tree on machine II, and it cannot found the EJBs at machine I, thus, machine II cannot access the beans.. But, if I deploy the EJBs at machine II, then EJB will be used in machine II (which should not be happened - for security purpose).
Please help.

===================================<br />Fear not, God know the best.<br />SCJP2 91%<br />SCWCD 89%<br />SCJD2 92% (143/155 pts)<br />SCEA Part I (89%)
Chris Mathews
Ranch Hand

Joined: Jul 18, 2001
Posts: 2712
Why would you expect the EJBs to be bound to the JNDI tree for Machine II? Your web application is going to have to get a Context for Machine I in order to use any EJB, right? In which case the JNDI lookup for the EJB would be taking place on Machine I... where it belongs.
[ September 15, 2002: Message edited by: Chris Mathews ]
Pearlo Muthukumaran
Ranch Hand

Joined: Sep 17, 2002
Posts: 79
If we are writing simple client for the EJBs deployed in a different system say clients for MDBs deployed in different system do we need weblogic.jar to be present in the local system for enabling the following code segment to work
Hashtable ht = new Hasttable();
InitialConetxt ictx = new InitialContext(ht);
Then do all sorts of activities based on
ccontext obtained
I guess that the weblogic.jar must be present in the local system and must be included in the classpath in order to successfully reach the JNDI tree of the remote machine
This is because i tried writing a MDB client on a virgin system having no traces of weblogic installation and got
ClassNotFoundException wrt weblogic.jndi.WLInitialContextFactory
May be because the InitialContext creation method requires the class in the local system
Please clarify if I am right. and please let me know in case i need to pack the weblogic.jar with the client classes what are the other basic essential files to be packed along with
Pearlo Muthukumaran
Ranch Hand

Joined: Sep 17, 2002
Posts: 79
I found out that when i copy the weblogic.jar in the different client system and include in the classpath, the initial Context lookup works fine and the JMS Client is able to perform the JNDI lookup of the server.
May be protocol handler for "t3://.." stuff and host of other helper classes are present in weblogic.jar file and therefore it works
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
If you�ve got a remote client you must have the required stubs included in the classpath: the EJB�s stubs & the helper classes stubs.
So the most typical option is to generate a JAR with all those classes.
I agree. Here's the link:
subject: Deploy EJB and Web separately
It's not a secret anymore!