File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes instance of server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "instance of server" Watch "instance of server" New topic
Author

instance of server

jignesh soni
Ranch Hand

Joined: Dec 10, 2007
Posts: 150
" only one instance of the server can be credated inside a given JVM" - This is from tomcat book

how is the instance of a server created ? I mean when I want create an object, it requires a program to instanciate an object. I dont see any program in here. Which program instanciates the server instance and how ?

When a program is started, it finishes executing automatically after sometime. Server is a program, once it is started it keeps running unless it is stopped. It keeps running and does not need to be restrted, even when computer is shut down and restarted. How does it keep running and never ends ?

This is very confusing to me, eventhough it sounds very basic. Please explain in detail.
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8833
    
    7

jignesh soni wrote:
how is the instance of a server created ? I mean when I want create an object, it requires a program to instanciate an object. I dont see any program in here. Which program instanciates the server instance and how ?

Tomcat is a program, just like Firefox or a text editor. However, it's purpose is to bind to a port and serve JSP's and other files.
If you look in the startup batch files, you'll see that all they do is invoke the java command on a class (in 5.5 the class is org.apache.catalina.startup.Bootstrap). You can check the running processes with ps or task manager and you'll see that a new java task is running alongside all the other processes. No magic necessary.

jignesh soni wrote:
When a program is started, it finishes executing automatically after sometime. Server is a program, once it is started it keeps running unless it is stopped. It keeps running and does not need to be restrted, even when computer is shut down and restarted. How does it keep running and never ends ?


I think you are striving for a distinction where there is none. A program is code executed by a computer. Some programs can be configured to start up when the computer is started (called "services" in the Windows world, "daemons" in the Unix world). Nothing runs when the computer is off. Again, no magic necessary.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: instance of server
 
Similar Threads
BufferedWriter
Knowing number of instances of an object?
RMI Server becoming unreferenced
server gui ? and safe shutdown
How does servlet stay active ?