LoginSignup
2
4

More than 5 years have passed since last update.

EclipseのサーバーからTomcatが起動しない

Posted at

❇︎メモ

環境

OS: macOS High Sierra (10.13)
Eclipse: 4.7.0

きっかけ

EclipseのサーバーからTomcat7を「開始」した際に以下のエラーが表示される。
スクリーンショット 2017-10-16 17.31.49.png

原因

Tomcatを起動したまま、Eclipseが終了してしまった場合にTomcatのプロセスが終了されずに残り続けてしまうことが原因。

対応

ターミナルにて以下のコマンドでtomcatのプロセスを取得。

ps -ef | grep tomcat

すると以下のようにtomcatでgrepされたプロセスの一覧を得られる。

502 58705     1   0  5:27PM ??         0:16.96 /Applications/Eclipse_4.7.0.app/Contents/java/7/Home/bin/java -Djava.ext.dirs=/Applications/Eclipse_4.7.0.app/Contents/java/7/Home/jre/lib/ext -Dcatalina.base=/Applications/Eclipse_4.7.0.app/Contents/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0 -Dcatalina.home=/Applications/Eclipse_4.7.0.app/Contents/tomcat/7 -Dwtp.deploy=/Applications/Eclipse_4.7.0.app/Contents/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps -Djava.endorsed.dirs=/Applications/Eclipse_4.7.0.app/Contents/tomcat/7/endorsed -Dfile.encoding=UTF-8 -classpath /Applications/Eclipse_4.7.0.app/Contents/tomcat/7/bin/bootstrap.jar:/Applications/Eclipse_4.7.0.app/Contents/tomcat/7/bin/tomcat-juli.jar:/Applications/Eclipse_4.7.0.app/Contents/java/7/Home/lib/tools.jar org.apache.catalina.startup.Bootstrap start
502 58933 58659   0  5:39PM ttys000    0:00.01 grep tomcat

左から順にUID, PID, PPID...なので、上の例では

kill 58705

とすれば、PIDが58705のtomcatのプロセスを終了させられる。
そして、Eclipseのサーバーから再度「開始」を実行すれば、問題なく立ち上がる。

もっと良い解決策があればご教授ください!

2
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
4