File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes How many instances of the JVM exist in a collocated application? 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 many instances of the JVM exist in a collocated application?" Watch "How many instances of the JVM exist in a collocated application?" New topic
Author

How many instances of the JVM exist in a collocated application?

Benjamin Weaver
Ranch Hand

Joined: Apr 08, 2003
Posts: 161
I am new to EJB and have the following question:
If I deploy a web-based application on a EJB 2.0-enabled J2EE server, and this application consists of 1 servlet, 3 JSPs, 2 session and 2 entity EJBs communicating in a COLLOCATED application via local (not remote) interfaces,
How many instances of the JVM are running?
My guess is 1. Is this correct?
vikasids sharma
Ranch Hand

Joined: Aug 01, 2003
Posts: 157
well Weaver
1. Point of view
i say when u are using local interfaces instead of remote interfaces, it means there is no inter JVM interactions rather they are intra JVM interactions .So single instance of JVM is running.
2. poit of view
say we have two JVMs running on m/c.Our client code implements JVM 1 and sever side components implement JVM 2 .Then we can say two instances of JVM are running.
please do comment .i may be wrong...
Originally posted by Benjamin Weaver:

If I deploy a web-based application on a EJB 2.0-enabled J2EE server, and this application consists of 1 servlet, 3 JSPs, 2 session and 2 entity EJBs communicating in a COLLOCATED application via local (not remote) interfaces,
How many instances of the JVM are running?
My guess is 1. Is this correct?


Thanks
Vikas Sharma
SCJP(1.4)
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
The use of local interfaces pretty much requires everything to run in a single JVM. Other than that, it's up to the application server vendor to decide how many JVMs they want to launch for running the containers.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
vikasids sharma
Ranch Hand

Joined: Aug 01, 2003
Posts: 157
So we must conclude by
"Cannot judge how manny number of instances are running ,all depends upon vendor specfic implementation"
right?
Originally posted by Lasse Koskela:
The use of local interfaces pretty much requires everything to run in a single JVM. Other than that, it's up to the application server vendor to decide how many JVMs they want to launch for running the containers.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Yes, I would say so.
Here's a quote from the J2EE specification:
This specification doesn�t require that a J2EE product be implemented by a single program, a single server, or even a single machine. In general, this specification doesn�t describe the partitioning of services or functions between machines, servers, or processes. As long as the requirements in this specification are met, J2EE Product Providers can partition the functionality however they see fit. A J2EE product must be able to deploy application components that execute with the semantics described by this specification.
A very simple J2EE product might be provided as a single Java virtual machine that supports applets, web components, and enterprise beans in one container (although this would be an extreme, and probably rare, case), and application clients each in their own container. A typical low end J2EE product will support applets in one of the popular browsers, application clients each in their own Java virtual machine, and will provide a single server that supports both web components and enterprise beans. A high end J2EE product might split the server components into multiple servers, each of which can be distributed and load-balanced across a collection of machines. This specification does not prescribe or preclude any of these configurations.
A wide variety of J2EE product configurations and implementations, all of
which meet the requirements of this specification, are possible. A portable J2EE application will function correctly when successfully deployed in any of these products.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How many instances of the JVM exist in a collocated application?
 
Similar Threads
Web Container on it's own or with application server
How many instances of EJB(business logic)
EJB Question
Issue with multiple JVM instances on WAS61, could some one please help me out?
Local Vs Remote