Eclipse - Starting Tomcat 7 Server at localhost has encountered a problem

17,589

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
Share:
17,589

Related videos on Youtube

Joe
Author by

Joe

Updated on September 18, 2022

Comments

  • Joe
    Joe almost 2 years

    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