vishveswara chary varanasi wrote:
Tomcat community has a wiki which providded the
http://wiki.apache.org/tomcat/HowTo#How_do_I_check_whether_Tomcat_is_UP_or_DOWN.3F_There_is_no_status_command

i have tried to connect to tomcat using sockect connection on the port
where the tomcat running


which is ?

 Socket socket = new Socket("hostname", port);


What is "hostname" in your case ? can the client resolve this name to an IP address corresponding to the Tomcat host ?

this works some time and some time even if the tomcat is up and
runnning this is throwing the java.net.ConnectException: Connection
timed out: connect.


When does it work and when not ?

please help me how i can test that whether tomcat is up and running on
a remote machine from a client machine.


Read this carefully : http://tomcat.apache.org/tomcat-7.0-doc/config/server.html
(all of it, but particularly the "address" attribute).

Unless I am mistaken, it means that by default Tomcat only listens, on that port, on the address "localhost", which usually is the IP address 127.0.0.1.
In other words, by default this will only work from a client running on the 
same host.

By using e.g. : address="0.0.0.0"
you could tell Tomcat to bind this listening socket to all the IP addresses of the Tomcat host. But then, you have to be extra careful not to allow just any client to stop Tomcat, just by connecting to that IP/port and sending "SHUTDOWN".

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to