File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to deploy ejb application on two jvms?

 
arpita kale
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 626
Mac
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 159
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Amit M Tank
Ranch Hand
Posts: 257
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic