Ubuntu 14.04のTomcat 7で非常に奇妙な動作をしています。
新しいVPSを作成し、default-jdkとその他の単純なものをインストールしました。 Tomcat 7をダウンロードして解凍しました。[myIP]:8080
で実行できることを確認し、Tomcatのインデックスページを確認しました。
VPSを再起動したら、Tomcatを再起動しましたが、[myIP]:8080
に応答がありません。エラーすらありません。ログを確認したところ、Tomcatが最初のWebアプリケーションでの展開の状態でハングしていることがわかりました。
マイログ :
Dec 31, 2014 9:06:04 AM org.Apache.catalina.startup.VersionLoggerListener log
INFO: Server version: Apache Tomcat/7.0.57
Dec 31, 2014 9:06:04 AM org.Apache.catalina.startup.VersionLoggerListener log
INFO: Server built: Nov 3 2014 08:39:16 UTC
Dec 31, 2014 9:06:04 AM org.Apache.catalina.startup.VersionLoggerListener log
INFO: Server number: 7.0.57.0
Dec 31, 2014 9:06:04 AM org.Apache.catalina.startup.VersionLoggerListener log
INFO: OS Name: Linux
Dec 31, 2014 9:06:04 AM org.Apache.catalina.startup.VersionLoggerListener log
INFO: OS Version: 3.13.0-37-generic
Dec 31, 2014 9:06:04 AM org.Apache.catalina.startup.VersionLoggerListener log
INFO: Architecture: AMD64
Dec 31, 2014 9:06:04 AM org.Apache.catalina.startup.VersionLoggerListener log
INFO: Java_HOME: /usr/lib/jvm/Java-7-openjdk-AMD64/jre
Dec 31, 2014 9:06:04 AM org.Apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version: 1.7.0_65-b32
Dec 31, 2014 9:06:04 AM org.Apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor: Oracle Corporation
Dec 31, 2014 9:06:04 AM org.Apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE: /opt/Tomcat
Dec 31, 2014 9:06:04 AM org.Apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME: /opt/Tomcat
Dec 31, 2014 9:06:04 AM org.Apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.util.logging.config.file=/opt/Tomcat/conf/logging.properties
Dec 31, 2014 9:06:04 AM org.Apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.util.logging.manager=org.Apache.juli.ClassLoaderLogManager
Dec 31, 2014 9:06:04 AM org.Apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.endorsed.dirs=/opt/Tomcat/endorsed
Dec 31, 2014 9:06:04 AM org.Apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=/opt/Tomcat
Dec 31, 2014 9:06:04 AM org.Apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=/opt/Tomcat
Dec 31, 2014 9:06:04 AM org.Apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.io.tmpdir=/opt/Tomcat/temp
Dec 31, 2014 9:06:04 AM org.Apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the Java.library.path: /usr/Java/packages/lib/AMD64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib
Dec 31, 2014 9:06:04 AM org.Apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Dec 31, 2014 9:06:04 AM org.Apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Dec 31, 2014 9:06:04 AM org.Apache.catalina.startup.Catalina load
INFO: Initialization processed in 2327 ms
Dec 31, 2014 9:06:04 AM org.Apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Dec 31, 2014 9:06:04 AM org.Apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.57
Dec 31, 2014 9:06:04 AM org.Apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /opt/Tomcat/webapps/Host-manager
Dec 31, 2014 9:11:09 AM org.Apache.catalina.util.SessionIdGenerator createSecureRandom
INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [303,104] milliseconds.
Dec 31, 2014 9:11:09 AM org.Apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory /opt/Tomcat/webapps/Host-manager has finished in 304,682 ms
Dec 31, 2014 9:11:09 AM org.Apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /opt/Tomcat/webapps/manager
Dec 31, 2014 9:11:09 AM org.Apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory /opt/Tomcat/webapps/manager has finished in 271 ms
Dec 31, 2014 9:11:09 AM org.Apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /opt/Tomcat/webapps/docs
Dec 31, 2014 9:11:09 AM org.Apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory /opt/Tomcat/webapps/docs has finished in 205 ms
Dec 31, 2014 9:11:09 AM org.Apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /opt/Tomcat/webapps/examples
Dec 31, 2014 9:11:11 AM org.Apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory /opt/Tomcat/webapps/examples has finished in 1,422 ms
Dec 31, 2014 9:11:11 AM org.Apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /opt/Tomcat/webapps/ROOT
Dec 31, 2014 9:11:11 AM org.Apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory /opt/Tomcat/webapps/ROOT has finished in 177 ms
Dec 31, 2014 9:11:11 AM org.Apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Dec 31, 2014 9:11:11 AM org.Apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Dec 31, 2014 9:11:11 AM org.Apache.catalina.startup.Catalina start
INFO: Server startup in 306957 ms
Dec 31, 2014 9:17:35 AM org.Apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["http-bio-8080"]
Dec 31, 2014 9:17:35 AM org.Apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["ajp-bio-8009"]
Dec 31, 2014 9:17:35 AM org.Apache.catalina.core.StandardService stopInternal
INFO: Stopping service Catalina
Dec 31, 2014 9:17:36 AM org.Apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["http-bio-8080"]
Dec 31, 2014 9:17:36 AM org.Apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["ajp-bio-8009"]
Dec 31, 2014 9:17:36 AM org.Apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["http-bio-8080"]
Dec 31, 2014 9:17:36 AM org.Apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["ajp-bio-8009"]
Dec 31, 2014 9:20:01 AM org.Apache.catalina.startup.VersionLoggerListener log
INFO: Server version: Apache Tomcat/7.0.57
Dec 31, 2014 9:20:01 AM org.Apache.catalina.startup.VersionLoggerListener log
INFO: Server built: Nov 3 2014 08:39:16 UTC
Dec 31, 2014 9:20:01 AM org.Apache.catalina.startup.VersionLoggerListener log
INFO: Server number: 7.0.57.0
Dec 31, 2014 9:20:01 AM org.Apache.catalina.startup.VersionLoggerListener log
INFO: OS Name: Linux
Dec 31, 2014 9:20:01 AM org.Apache.catalina.startup.VersionLoggerListener log
INFO: OS Version: 3.13.0-37-generic
Dec 31, 2014 9:20:01 AM org.Apache.catalina.startup.VersionLoggerListener log
INFO: Architecture: AMD64
Dec 31, 2014 9:20:01 AM org.Apache.catalina.startup.VersionLoggerListener log
INFO: Java_HOME: /usr/lib/jvm/Java-7-openjdk-AMD64/jre
Dec 31, 2014 9:20:01 AM org.Apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version: 1.7.0_65-b32
Dec 31, 2014 9:20:01 AM org.Apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor: Oracle Corporation
Dec 31, 2014 9:20:01 AM org.Apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE: /opt/Tomcat
Dec 31, 2014 9:20:01 AM org.Apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME: /opt/Tomcat
Dec 31, 2014 9:20:01 AM org.Apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.util.logging.config.file=/opt/Tomcat/conf/logging.properties
Dec 31, 2014 9:20:01 AM org.Apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.util.logging.manager=org.Apache.juli.ClassLoaderLogManager
Dec 31, 2014 9:20:01 AM org.Apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.endorsed.dirs=/opt/Tomcat/endorsed
Dec 31, 2014 9:20:01 AM org.Apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=/opt/Tomcat
Dec 31, 2014 9:20:01 AM org.Apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=/opt/Tomcat
Dec 31, 2014 9:20:01 AM org.Apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.io.tmpdir=/opt/Tomcat/temp
Dec 31, 2014 9:20:01 AM org.Apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the Java.library.path: /usr/Java/packages/lib/AMD64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib
Dec 31, 2014 9:20:01 AM org.Apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Dec 31, 2014 9:20:01 AM org.Apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Dec 31, 2014 9:20:01 AM org.Apache.catalina.startup.Catalina load
INFO: Initialization processed in 1536 ms
Dec 31, 2014 9:20:02 AM org.Apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Dec 31, 2014 9:20:02 AM org.Apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.57
Dec 31, 2014 9:20:02 AM org.Apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /opt/Tomcat/webapps/Host-manager
Dec 31, 2014 9:33:38 AM org.Apache.catalina.startup.VersionLoggerListener log
INFO: Server version: Apache Tomcat/7.0.57
Dec 31, 2014 9:33:38 AM org.Apache.catalina.startup.VersionLoggerListener log
INFO: Server built: Nov 3 2014 08:39:16 UTC
Dec 31, 2014 9:33:38 AM org.Apache.catalina.startup.VersionLoggerListener log
INFO: Server number: 7.0.57.0
Dec 31, 2014 9:33:38 AM org.Apache.catalina.startup.VersionLoggerListener log
INFO: OS Name: Linux
Dec 31, 2014 9:33:38 AM org.Apache.catalina.startup.VersionLoggerListener log
INFO: OS Version: 3.13.0-37-generic
Dec 31, 2014 9:33:38 AM org.Apache.catalina.startup.VersionLoggerListener log
INFO: Architecture: AMD64
Dec 31, 2014 9:33:38 AM org.Apache.catalina.startup.VersionLoggerListener log
INFO: Java_HOME: /usr/lib/jvm/Java-7-openjdk-AMD64/jre
Dec 31, 2014 9:33:38 AM org.Apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version: 1.7.0_65-b32
Dec 31, 2014 9:33:38 AM org.Apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor: Oracle Corporation
Dec 31, 2014 9:33:38 AM org.Apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE: /opt/Tomcat
Dec 31, 2014 9:33:38 AM org.Apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME: /opt/Tomcat
Dec 31, 2014 9:33:38 AM org.Apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.util.logging.config.file=/opt/Tomcat/conf/logging.properties
Dec 31, 2014 9:33:38 AM org.Apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.util.logging.manager=org.Apache.juli.ClassLoaderLogManager
Dec 31, 2014 9:33:38 AM org.Apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.endorsed.dirs=/opt/Tomcat/endorsed
Dec 31, 2014 9:33:38 AM org.Apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=/opt/Tomcat
Dec 31, 2014 9:33:38 AM org.Apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=/opt/Tomcat
Dec 31, 2014 9:33:38 AM org.Apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.io.tmpdir=/opt/Tomcat/temp
Dec 31, 2014 9:33:38 AM org.Apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the Java.library.path: /usr/Java/packages/lib/AMD64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib
Dec 31, 2014 9:33:38 AM org.Apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Dec 31, 2014 9:33:38 AM org.Apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Dec 31, 2014 9:33:38 AM org.Apache.catalina.startup.Catalina load
INFO: Initialization processed in 2495 ms
Dec 31, 2014 9:33:39 AM org.Apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Dec 31, 2014 9:33:39 AM org.Apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.57
Dec 31, 2014 9:33:39 AM org.Apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /opt/Tomcat/webapps/Host-manager
74行目までは、これは通常のサーバー起動です。すべての標準Webアプリケーションがデプロイされました(行48〜68)が、その後ハングしました。そこで、サーバーを停止してシステムを再起動しました。 Tomcatを再び開始し、奇跡が始まります。次のセッションは89〜136行目にあり、Server startup in xxxx ms
のエントリがないことがわかります。
展開中にハングアップするだけで、この状況は常に繰り返されます。何が原因でしょうか?私はこの問題に苦労して何時間も費やしてきましたが、気が狂ってどこにも行きません。
考えられる問題は、エントロピーの増加を待つTomcatです。 jstack
を使用していくつかのスレッドダンプを取得し、誰が何を待っているかを確認します。
Tomcat 7+は、SecureRandom
クラスに大きく依存して、セッションIDなどにランダムな値を提供します。 JREによっては、SecureRandom
の初期化に使用されるエントロピーソースのエントロピーが不足している場合、起動時に遅延が発生する可能性があります。
問題がエントロピーである場合、次のシステムプロパティを設定することにより、ノンブロッキングエントロピーソースを使用するようにJREを設定する方法があります。
-Djava.security.egd=file:/dev/./urandom
問題の考えられる原因:キーストアファイルのパスの入力エラー:
keystoreFile="conf/cert/certificate.ks"
誰かのために役立つかもしれません:
Pom.xmlにそのような依存関係がないことを確認してください:
<dependency>
<groupId>org.Apache.Tomcat.maven</groupId>
<artifactId>Tomcat7-maven-plugin</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>org.Apache.Tomcat</groupId>
<artifactId>Tomcat-catalina</artifactId>
<version>8.0.23</version>
</dependency>