File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes shutdown  tomcat on port 8005 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "shutdown  tomcat on port 8005" Watch "shutdown  tomcat on port 8005" New topic

shutdown tomcat on port 8005

bulent yuce

Joined: Jul 29, 2007
Posts: 4
Hello everybody.

Why tomcat use port 8005?It is writing in server.xml file under %CATALINA_HOME%/conf.
... <Server port="8005" shutdown="SHUTDOWN"> ...
Is it for shutdown tomcat process?

I am starting tomcat with startup.bat in command line.
When i want to shutdown it in a new command line with shutdown.bat i took the following error:
"The process cannot access the file because it is being used by another process."

I can only shutdown tomcat process by closing the command line window that opened after i run startup.bat

Can anybody explain me the logic in shutdown?

Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15091

Besides the normal port that Tomcat listens on for connections (which is port 8080 by default), it also listens for commands on a different port (8005). Programs like shutdown.bat for example send special commands to a running Tomcat instance via this port to tell it to shutdown.

The error you get when you run shutdown.bat is strange, that shouldn't happen...

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
bulent yuce

Joined: Jul 29, 2007
Posts: 4
I take this error on Windows OS.
But when i tried to shutdown tomcat server via command on linux, it stopped tomcat server.

So i couldn't understand the reason of that.

When i look inside or there isn't any port number 8005.

So how can command send stop request to the running process?
Do you have any idea about that?

I agree. Here's the link:
subject: shutdown tomcat on port 8005
It's not a secret anymore!