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 how ejb is related  for distributed appications ? 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 ejb is related  for distributed appications ?" Watch "how ejb is related  for distributed appications ?" New topic

how ejb is related for distributed appications ?

arpita kale

Joined: Jun 13, 2007
Posts: 11
Hello Everybody
I have one conceptual question here.I want to know how ejb is related to distributed technology.I read from internet.I got the following points from internet.
After client server model,there are some disadvantages for client-server model.Therefore multitier application also called as distributed applications required to developed.In a multi-tier application, only the user interface stays on local machines while the logic of the application runs in the middle tier on a server. The final tier is still the stored data. When the logic of an application needs updating, changes are made to the software of the middle tier on the server, greatly simplifying the management of updates.But creating reliable, secure, and easily managed distributed applications is notoriously difficult. For example, managing transactions over a distributed system is a major task. Fortunately, using components that follow the EJB specification to build distributed systems relieves much of the burden.

If I develop webapplication...then jsp of applicataion is presentation part....classes will contain business logic part and database will reside on some anoather machine...So my war file will contain all .class files and jap files.I will deploy the war file on server say websphere.Then here the application becomes 3 tier.I can access the application from machine if I provide url and portno of that application.Then here where the concept of EJB requires.EJB uses RMI mechanism where the remote method invocation requires...In which case differents jvms will be required?and Rmi and Ejbs will be required???I want an example about it.?what do you mean by component model ?

I am preparing for scbcd.But before starting i am not getting the purpose of EJB itself.Everywhere it is explained in verymuch technical terms.I am not able to get it properly.CAN ANYBODY CLERIFY THIS TO ME ?
Amit M Tank
Ranch Hand

Joined: Mar 28, 2004
Posts: 257
Hi Arpita,

EJB is an extension of RMI. RMI means remote method invocation. So suppose you have a RMI client and a RMI server (both running in different JVM, may or may not run on the same machine) then they are called distributed. If you have your entire code in a war then everything is local, there is no concept of distributed computing here.

By component based architecture it means that you have your application divided in different components. Each component (Ear or EJB) can be separately deployed in a standalone EJB Container. Your War can be a different component deployed in a different server like tomcat in machine 1 and it would do a lookup to use EJBs deployed in different app server on machine2.

You will have a better understanding if you could work out small examples of RMI in 2 machines.


Amit Tank
Linked In
Karan Kaw

Joined: Jan 05, 2013
Posts: 14
Client Server typically means "Web Browser(Thin Client)===========WebServer(JSP)/Database"

EJB is distributed because it is roughly 3 Tier
Browser =====================JSP/Web MVC=============Pojo/Bean/Model(EJB/MDB)==========Database
EJB is distributed because Usually we have separate JVMs for Web and EJB Containers

RMI was used to call remote methods on different JVM just like EJB but Major Differnce is That EJB = RMI+Container Provided Services/Lifecycle/Transaction
RMI = one JVM called diferent Class method running in different VM and Developer was responsible for everything.

RMI uses IIOP(CORBA Compliant means .NET services)/JRMP(All In Java)
I agree. Here's the link:
subject: how ejb is related for distributed appications ?
It's not a secret anymore!