• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

How to deploy ejb application on two jvms?  RSS feed

 
Greenhorn
Posts: 11
  • 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??
 
Greenhorn
Posts: 5
  • 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.
 
Ranch Hand
Posts: 626
Mac
  • 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.
 
Ranch Hand
Posts: 159
  • 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
 
Ranch Hand
Posts: 257
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!