###前提・実現したいこと
CentOS7、systemdで、Tomcat8を使用。
JavaプログラムのSystem.exit()メソッドで、Tomcatを終了させてしまいました。
↓以下を修正しました。
tomcatを再起動すると、tomcat自体の起動はできているように見えるものの、リッスンが失敗しているのかブラウザからWebアプリケーションにはアクセスができません。
(※載せていたエラーは、systemdでtomcatが起動されている状態から、コマンドライン上でtomcatの起動コマンドを実行した際のもので、ポート競合が原因とはいえないかもしれません。)
解決法ご存じの方ご教授ください。
###発生している問題・エラーメッセージ
★systemctl restart実行後の、systemctl status結果
(Active: active(runnning)であるべきと思っています)
# systemctl status tomcat8.service -l ● tomcat8.service - Apache Tomcat 8 Loaded: loaded (/usr/lib/systemd/system/tomcat8.service; enabled; vendor preset: disabled) Active: active (exited) since 木 2016-08-25 13:30:32 JST; 45s ago Process: 6845 ExecStop=/opt/apache-tomcat/apache-tomcat-8.0.24/bin/shutdown.sh (code=exited, status=0/SUCCESS) Process: 6885 ExecStart=/opt/apache-tomcat/apache-tomcat-8.0.24/bin/startup.sh (code=exited, status=0/SUCCESS) Main PID: 6885 (code=exited, status=0/SUCCESS) CGroup: /system.slice/tomcat8.service └─6899 /usr/bin/java -Djava.util.logging.config.file=/opt/apache-tomcat/apache-tomcat-8.0.24/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/opt/apache-tomcat/apache-tomcat-8.0.24/endorsed -classpath .:/opt/apache-tomcat/apache-tomcat-8.0.24/lib/servlet-api.jar:/root/postgresql_jdbc/postgresql-9.4-1202.jdbc42.jar:/opt/apache-tomcat/apache-tomcat-8.0.24/bin/bootstrap.jar:/opt/apache-tomcat/apache-tomcat-8.0.24/bin/tomcat-juli.jar -Dcatalina.base=/opt/apache-tomcat/apache-tomcat-8.0.24 -Dcatalina.home=/opt/apache-tomcat/apache-tomcat-8.0.24 -Djava.io.tmpdir=/opt/apache-tomcat/apache-tomcat-8.0.24/temp org.apache.catalina.startup.Bootstrap start 8月 25 13:30:32 erp systemd[1]: Starting Apache Tomcat 8... 8月 25 13:30:32 erp startup.sh[6885]: Using CATALINA_BASE: /opt/apache-tomcat/apache-tomcat-8.0.24 8月 25 13:30:32 erp startup.sh[6885]: Using CATALINA_HOME: /opt/apache-tomcat/apache-tomcat-8.0.24 8月 25 13:30:32 erp startup.sh[6885]: Using CATALINA_TMPDIR: /opt/apache-tomcat/apache-tomcat-8.0.24/temp 8月 25 13:30:32 erp startup.sh[6885]: Using JRE_HOME: /usr 8月 25 13:30:32 erp startup.sh[6885]: Using CLASSPATH: .:/opt/apache-tomcat/apache-tomcat-8.0.24/lib/servlet-api.jar:/root/postgresql_jdbc/postgresql-9.4-1202.jdbc42.jar:/opt/apache-tomcat/apache-tomcat-8.0.24/bin/bootstrap.jar:/opt/apache-tomcat/apache-tomcat-8.0.24/bin/tomcat-juli.jar 8月 25 13:30:32 erp startup.sh[6885]: Tomcat started. 8月 25 13:30:32 erp systemd[1]: Started Apache Tomcat 8.
★tomcatが再起動される際のシステムログ
Aug 24 20:16:11 erp systemd: Stopping Apache Tomcat 8... Aug 24 20:16:11 erp shutdown.sh: Using CATALINA_BASE: /opt/apache-tomcat/apache-tomcat-8.0.24 Aug 24 20:16:11 erp shutdown.sh: Using CATALINA_HOME: /opt/apache-tomcat/apache-tomcat-8.0.24 Aug 24 20:16:11 erp shutdown.sh: Using CATALINA_TMPDIR: /opt/apache-tomcat/apache-tomcat-8.0.24/temp Aug 24 20:16:11 erp shutdown.sh: Using JRE_HOME: /usr Aug 24 20:16:11 erp shutdown.sh: Using CLASSPATH: .:/opt/apache-tomcat/apache-tomcat-8.0.24/lib/servlet-api.jar:/root/postgresql_jdbc/postgresql-9.4-1202.jdbc42.jar:/opt/apache-tomcat/apache-tomcat-8.0.24/bin/bootstrap.jar:/opt/apache-tomcat/apache-tomcat-8.0.24/bin/tomcat-juli.jar Aug 24 20:16:11 erp shutdown.sh: 8 24, 2016 8:16:11 午後 org.apache.catalina.startup.Catalina stopServer Aug 24 20:16:11 erp shutdown.sh: 重大: Could not contact localhost:8005. Tomcat may not be running. Aug 24 20:16:11 erp shutdown.sh: 8 24, 2016 8:16:11 午後 org.apache.catalina.startup.Catalina stopServer Aug 24 20:16:11 erp shutdown.sh: 重大: Catalina.stop: Aug 24 20:16:11 erp shutdown.sh: java.net.ConnectException: 接続を拒否されました Aug 24 20:16:11 erp shutdown.sh: at java.net.PlainSocketImpl.socketConnect(Native Method) Aug 24 20:16:11 erp shutdown.sh: at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) Aug 24 20:16:11 erp shutdown.sh: at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) Aug 24 20:16:11 erp shutdown.sh: at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) Aug 24 20:16:11 erp shutdown.sh: at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) Aug 24 20:16:11 erp shutdown.sh: at java.net.Socket.connect(Socket.java:589) Aug 24 20:16:11 erp shutdown.sh: at java.net.Socket.connect(Socket.java:538) Aug 24 20:16:11 erp shutdown.sh: at java.net.Socket.<init>(Socket.java:434) Aug 24 20:16:11 erp shutdown.sh: at java.net.Socket.<init>(Socket.java:211) Aug 24 20:16:11 erp shutdown.sh: at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:450) Aug 24 20:16:11 erp shutdown.sh: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) Aug 24 20:16:11 erp shutdown.sh: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) Aug 24 20:16:11 erp shutdown.sh: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) Aug 24 20:16:11 erp shutdown.sh: at java.lang.reflect.Method.invoke(Method.java:497) Aug 24 20:16:11 erp shutdown.sh: at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:400) Aug 24 20:16:11 erp shutdown.sh: at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:487) Aug 24 20:16:11 erp systemd: Stopped Apache Tomcat 8. Aug 24 20:16:32 erp systemd: Starting Apache Tomcat 8... Aug 24 20:16:32 erp startup.sh: Using CATALINA_BASE: /opt/apache-tomcat/apache-tomcat-8.0.24 Aug 24 20:16:32 erp startup.sh: Using CATALINA_HOME: /opt/apache-tomcat/apache-tomcat-8.0.24 Aug 24 20:16:32 erp startup.sh: Using CATALINA_TMPDIR: /opt/apache-tomcat/apache-tomcat-8.0.24/temp Aug 24 20:16:32 erp startup.sh: Using JRE_HOME: /usr Aug 24 20:16:32 erp startup.sh: Using CLASSPATH: .:/opt/apache-tomcat/apache-tomcat-8.0.24/lib/servlet-api.jar:/root/postgresql_jdbc/postgresql-9.4-1202.jdbc42.jar:/opt/apache-tomcat/apache-tomcat-8.0.24/bin/bootstrap.jar:/opt/apache-tomcat/apache-tomcat-8.0.24/bin/tomcat-juli.jar Aug 24 20:16:32 erp startup.sh: Tomcat started. Aug 24 20:16:32 erp systemd: Started Apache Tomcat 8.
★tomcat8.service起動状態(上記)での、ポート使用状況
# lsof -i:8080 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME java 6899 root 50u IPv6 300179 0t0 TCP *:webcache (LISTEN) # lsof -i:8009 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME java 6899 root 55u IPv6 300183 0t0 TCP *:8009 (LISTEN) # netstat -anp | grep 8080 tcp6 0 0 :::8080 :::* LISTEN 6899/java # netstat -anp | grep 8009 tcp6 0 0 :::8009 :::* LISTEN 6899/java
★tomcatプロセス
# ps -aux | fgrep -i tomcat root 6899 101 0.9 11634804 316632 ? Sl 13:30 43:15 /usr/bin/java -Djava.util.logging.config.file=/opt/apache-tomcat/apache-tomcat-8.0.24/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/opt/apache-tomcat/apache-tomcat-8.0.24/endorsed -classpath .:/opt/apache-tomcat/apache-tomcat-8.0.24/lib/servlet-api.jar:/root/postgresql_jdbc/postgresql-9.4-1202.jdbc42.jar:/opt/apache-tomcat/apache-tomcat-8.0.24/bin/bootstrap.jar:/opt/apache-tomcat/apache-tomcat-8.0.24/bin/tomcat-juli.jar -Dcatalina.base=/opt/apache-tomcat/apache-tomcat-8.0.24 -Dcatalina.home=/opt/apache-tomcat/apache-tomcat-8.0.24 -Djava.io.tmpdir=/opt/apache-tomcat/apache-tomcat-8.0.24/temp org.apache.catalina.startup.Bootstrap start
###試したこと
・systemctl restartで、tomcatのサービスを再起動⇒改善せず
・サーバ再起動⇒改善せず
・server.xmlに重複定義はなし
###補足情報(言語/FW/ツール等のバージョンなど)
回答5件
あなたの回答
tips
プレビュー