Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tomcat wont shut down 3

Status
Not open for further replies.

jsp1611

Programmer
May 5, 2003
2
0
0
GB
Tomcat wont shut down when I execute shutdown.bat
Tomcat now starts up whenever I start up the computer (which I do not remember specifying)- I can see it running (Tomcat.exe) in the background when I open Windows Task Manager, and the only way to kill the process is to kill it from inside task manager. Im running Tomcat on Win XP Pro and the error message I get is

C:\Apache\Tomcat 4.1\bin>shutdown
Using CATALINA_BASE: C:\Apache\Tomcat 4.1
Using CATALINA_HOME: C:\Apache\Tomcat 4.1
Using CATALINA_TMPDIR: C:\Apache\Tomcat 4.1\temp
Using JAVA_HOME: C:\j2sdk1.4.1_02
Catalina.stop: java.net.ConnectException: Connection refused: connect
java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
at java.net.Socket.connect(Socket.java:426)
at java.net.Socket.connect(Socket.java:376)
at java.net.Socket.<init>(Socket.java:291)
at java.net.Socket.<init>(Socket.java:119)
at org.apache.catalina.startup.Catalina.stop(Catalina.java:581)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:402)
at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
C:\Apache\Tomcat 4.1\bin>

Aside from the non-existant shudown functionality I seem to be able to run servlets and JSPs just fine.
I hope someone knows whats wrong.
Jon
 
I'm not a tomcat on Windoze xpurt so I can only speak from a Linux/Unix perspective, I have seen this problem of tomcat not shutting down and I believe that it is when there is an active connection to tomcat port, once all connections are disconnected or timed out then tomcat will (in my exp') shutdown.

On Linux I use a personal script to stop tomcat (seek & destroy &quot;kill -9&quot;) however I cannot comment on Windoze (Sorry!). How are you serving tomcat, is it via the httpd ports, or via AJP type connector? In my case where I use a webserver to pass the requests to tomcat I have been able to stop the webserver to disconnect the connections to teh tomcat port and the shutdown then works.

Sorry I cannot be more help.

L.
 
I had this problem. There was an entry in the &quot;W2k services&quot; window for Tomcat that was set to &quot;Automatic&quot;. I changed this to &quot;Manual&quot; and stopped having the problem. Get there from Settings->Administrative Tools->Computer Management->Services and Applications->Services.
 
Thank you very much Merric!! I managed to find the entry you pointed out and Ive changed it to &quot;manual&quot;. It now saves me having to kill the process in Task manager.
Cheers
Jon
 
When Tomcat starts automatically as a service, you see the Tomcat.exe process in task manager.

However, if you start tomcat using startup.bat, you get a java.exe task instead.

If you execute startup.bat first and then start the service, you can end up with two instances, only one of which can possibly work.
If you then shut the working one with shutdown.bat, you are left with a running Tomcat.exe, that doesn't work, and that won't shut! All highly confusing.

Therefore, if you start Tomcat as a service, you must also stop it as a service, and if you start it using startup.bat, you need to stop it using shutdown.bat.

You need to choose which way you want to run it and stick with that. You can change from one to the other later, but don't mix the two.

The message you got is actually the message that is given if you try to stop a server that isn't running (try executing shutdown.bat twice).


Also, beware of IE's page cache. Even if you shutdown Tomcat, you may still see the Tomcat home page (looks like Tomcat is still running) until you &quot;Delete all temporary internet files&quot;.
For development purposes at least, changing the IE &quot;check for newer versions of stored pages&quot; option to &quot;every visit to page&quot; is more useful.

All the above using XP, IE6, and Tomcat 4.1. May or may not apply to other configurations.

Nick.


 
Nice one Nick you deserve a star!

Me being a (84%) Linux guy its nice to see a good description of a Win32 solution.

Well done.
Laurie.
 
I just installed tomcat and it wasn't working (I sort of expected that), complaining about not being able to compile JSPs, and it actually turned out to be this problem here discussed, Windows2000 started the service automatically but bogusly, because its tomcat service does not work. Not being able to shutdown tomcat was particularly funny in my case, as I could NOT kill the process via the task manager!

So I am glad I lazily tried to solve the easier problem first :p

Thanks!
 
Can U help me out for windows 98 as I am getting the same problem......I have set all Env-variables properly but I am still getting this error.Also I have taken care of out of environment space issue
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top