aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes How to deploy ejb application on two jvms? 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 "How to deploy ejb application on two jvms?" Watch "How to deploy ejb application on two jvms?" New topic
Author

How to deploy ejb application on two jvms?

arpita kale
Greenhorn

Joined: Jun 13, 2007
Posts: 11
We deploy ear file which contains jar and war�

So when we deploy ear then both client part and bean part will be on the same machine��then application will not de deployed on two or more jvms.

Most of the time ear file is used for deployment then mostly client part and ejb part both will be deployed on one server one jvm.

but ejb is mostly used for distributed applications.
if we deploy only bean code on one jvm and other part(client code ) on other machine �.then here we will use ear file or not ?

How we will deploy code in two jvms?how we are deploying it on two machines ?

Please clear this concept.I want to run call session bean example method from one jvm to other jvm client code.I want guidelines to do it??
Naresh Narayana
Greenhorn

Joined: Aug 17, 2006
Posts: 5
I assume two JVMs to be two servers.

You can deploy WAR, EAR, EJB-jars independently.

All that you need is to give corresponding server parameters to "InitialContext". Subsequently, you can lookup and use the enterprise modules.
Jignesh Patel
Ranch Hand

Joined: Nov 03, 2001
Posts: 626

Arpita,

I have hard time to understand what you are trying explain.

There is a difference between Client Application and EJB App.

They are different pieces. Most of the time client application we create is just to test EJBs from local machine, whether they are working fine or not.

Normally, EJBs are part of Web application and they never called directly.
From Browser when we send request, Servlet called and in turn servlet calls EJBs through Business Delegate or Facade Pattern.
Jetendra Ivaturi
Ranch Hand

Joined: Feb 08, 2007
Posts: 159
Hi

Correct me if I m wrong. First thing I wanted to clear you. Two JVM's need not be two seperate machines, it can be two managed servers too. So bind those managed servers in to a cluster and delpoy your ear on to that Cluster.

If you are not looking for that... You can't directly deploy ear on two JVM's which leads to ClassLoader problem. So, bind your beans to a .jar and your client to .war then deploy it noramlly. Now add the .jar to your server class path which resolves the issue. Or we have some tools which creates a client ".jar" meaning the files which are required by client. That will also resolve the things I belive.

Thanks

Jetendra


SCJP 1.4 & 1.5, SCWCD 1.5. Learn and Let Learn.
Amit M Tank
Ranch Hand

Joined: Mar 28, 2004
Posts: 257

We deploy ear file which contains jar and war�

So when we deploy ear then both client part and bean part will be on the same machine��then application will not de deployed on two or more jvms.

Most of the time ear file is used for deployment then mostly client part and ejb part both will be deployed on one server one jvm.



I think you want your JSP/Servlet code and EJB Code to be deployed in different servers. You can do it. Have all the EJB code in an EAR an deployed in "Server1". Have the Home, Remote Interfaces and Stubs (EJB client jar) along with the JSP, Servlets in a seperate war and deploy it in the "server2". When the Servlets or Business Delegates call the EJB use the JNDI and url of "Server1" for EJB lookup. You could use properties file in the classpath to read the ejb server url. Hope ths helps.

Amit Tank


Amit Tank
Linked In
 
Don't get me started about those stupid light bulbs.
 
subject: How to deploy ejb application on two jvms?
 
Similar Threads
JEE5 bean and war deployment
Java Thin Application Client
General design questions
Type of J2EE application
How 2 jboss communicate with each other ?