Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm not able to stop tomcat. I'm running on Fedora 13, and stopping the service in the usual way:

/etc/init.d/tomcat6 stop

but I get a FAILED message. Catalina.out says:

Error: Exception thrown by the agent : java.rmi.server.ExportException: Port already in use: 8086; nested exception is:
    java.net.BindException: Address already in use

Thanks

share|improve this question

2 Answers 2

Find process, who listens 8086:

lsof -i :8086

and kill

kill -9 PID

Or stop all Java application:

 killall java

if it does not help

 killall -9 java
share|improve this answer
    
Thanks for your answer. Actually what I usually do is: ps aux | grep tomcat and then: kill -9 PID, and it works. But I'd like to know why the tomcat stop is not working. –  Andres Feb 3 '11 at 17:32
    
Opt for pkill over killall, it may save your butt if you ever log on to a Solaris machine. –  Jodie C Jul 3 '11 at 1:35

The answer to your question is in the exception thrown. Another application is listening on the same port 8086. This could perhaps be the fact that you have 2 instance of tomcat running. Main possibility could have been a container/java app thread ended prematurely and therefore left an instance still hanging. Normally doing ps aux | grep java should tell you what is currently utilising jvm. Then you can kill all and restart tomcat to resolve the issue. But if this is not the case and thus another service is listening on port 8086 - then my advice will be, go to $CATALINA_HOME/conf/server.xml and search and replace 8086 with different port number.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.