Tuesday, April 30, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 17782  / 2 Years ago, sun, august 21, 2022, 10:35:24

I got this error just after getting an Ubuntu error with eclipse and it forced to close the program.




Several ports (8005, 8080, 8009) required by Tomcat v7.0 Server at
localhost are already in use. The server may already be running in
another process, or a system process may be using the port. To start
this server you will need to stop the other process or change the port
number(s).




I got that error even after stopping manually the server



$> sudo /etc/init.d/tomcat7 stop
* Stopping Tomcat servlet engine tomcat7 [ OK ]

$> sudo /etc/init.d/tomcat7 status
* Tomcat servlet engine is not running.


What could I do without having to reboot the computer?



System details




  • Ubuntu 13.10

  • Eclipse Kepler Service Release 1

  • Tomcat v 7.0.50


More From » 13.10

 Answers
6

You can use this command to identify any Tomcat process running in the background:



ps -ef | grep "org.apache.catalina.startup.Bootstrap" | grep -v grep


You should get a row like this for each running instance:



username    26546  5581 71 12:51 ?        00:00:07 /usr/lib/jvm/java-6-openjdk-amd64/bin/java -Dcatalina.base=/home/ringo/eclipseWorkspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0 -Dcatalina.home=/home/ringo/java/apache-tomcat-7.0.37 -Dwtp.deploy=/home/ringo/eclipseWorkspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps -Djava.endorsed.dirs=/home/ringo/java/apache-tomcat-7.0.37/endorsed -Dfile.encoding=UTF-8 -classpath /home/ringo/java/apache-tomcat-7.0.37/bin/bootstrap.jar:/home/ringo/java/apache-tomcat-7.0.37/bin/tomcat-juli.jar:/usr/lib/jvm/java-6-openjdk-amd64/lib/tools.jar org.apache.catalina.startup.Bootstrap start


The second value on the row is the process ID. You can then use the kill command to terminate it, e.g.:



kill -9 26546


To both find the process and kill it in a single command:



ps -ef | grep "org.apache.catalina.startup.Bootstrap" | grep -v grep | awk '{ print $2 }' | xargs kill -9

[#26865] Tuesday, August 23, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
imberst

Total Points: 370
Total Questions: 107
Total Answers: 123

Location: French Polynesia
Member since Tue, Jul 7, 2020
4 Years ago
imberst questions
;