Azure

Tomcat 8掛起部署Jasper,熵沒有幫助

  • June 18, 2020

我有一台帶有多個 tomcat 應用程序的 Azure 機器。我正在配置它們並重新啟動它們,直到突然帶有 jasper 的 tomcat 在部署時停止。沒有錯誤,最後一句是

Jun 18 16:49:10 RE1 catalina.sh: 18-Jun-2020 16:49:10.273 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.23
Jun 18 16:49:10 RE1 catalina.sh: 18-Jun-2020 16:49:10.281 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /opt/app/jasper/apache-tomcat-8.0.23/webapps/jasperserver

我發現這可能是熵失去造成的,所以我修改了JAVA_OPTS:

export JAVA_OPTS="-Xmx2048m -Djava.security.egd=file:/dev/./urandom"

好吧,它沒有幫助。這是執行緒轉儲的一部分。知道如何解決這個問題嗎?

Jun 18 16:52:19 RE1 catalina.sh: Full thread dump OpenJDK 64-Bit Server VM (25.252-b09 mixed mode):
Jun 18 16:52:19 RE1 catalina.sh: "localhost-startStop-1" #15 daemon prio=5 os_prio=0 tid=0x00007f59a0002000 nid=0x121cb runnable [0x00007f59ea1a9000]
Jun 18 16:52:19 RE1 catalina.sh: java.lang.Thread.State: RUNNABLE
Jun 18 16:52:19 RE1 catalina.sh: at java.io.UnixFileSystem.getBooleanAttributes0(Native Method)
Jun 18 16:52:19 RE1 catalina.sh: at java.io.UnixFileSystem.getBooleanAttributes(UnixFileSystem.java:242)
Jun 18 16:52:19 RE1 catalina.sh: at java.io.File.isDirectory(File.java:849)
Jun 18 16:52:19 RE1 catalina.sh: at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1983)
Jun 18 16:52:19 RE1 catalina.sh: at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
Jun 18 16:52:19 RE1 catalina.sh: at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
Jun 18 16:52:19 RE1 catalina.sh: at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:771)
Jun 18 16:52:19 RE1 catalina.sh: - locked <0x00000000830ccfe8> (a org.apache.catalina.startup.ContextConfig)
Jun 18 16:52:19 RE1 catalina.sh: at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:305)
Jun 18 16:52:19 RE1 catalina.sh: at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
Jun 18 16:52:19 RE1 catalina.sh: at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
Jun 18 16:52:19 RE1 catalina.sh: at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5066)
Jun 18 16:52:19 RE1 catalina.sh: - locked <0x00000000830ccda8> (a org.apache.catalina.core.StandardContext)
Jun 18 16:52:19 RE1 catalina.sh: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
Jun 18 16:52:19 RE1 catalina.sh: - locked <0x00000000830ccda8> (a org.apache.catalina.core.StandardContext)
Jun 18 16:52:19 RE1 catalina.sh: at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
Jun 18 16:52:19 RE1 catalina.sh: at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
Jun 18 16:52:20 RE1 catalina.sh: at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
Jun 18 16:52:20 RE1 catalina.sh: at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1101)

Jun 18 16:52:20 RE1 catalina.sh: "Catalina-startStop-1" #14 daemon prio=5 os_prio=0 tid=0x00007f5a086ad800 nid=0x121ca waiting on condition [0x00007f59ea2ae000]
Jun 18 16:52:20 RE1 catalina.sh: java.lang.Thread.State: WAITING (parking)
Jun 18 16:52:20 RE1 catalina.sh: at sun.misc.Unsafe.park(Native Method)
Jun 18 16:52:20 RE1 catalina.sh: - parking to wait for  <0x00000000830db920> (a java.util.concurrent.FutureTask)
Jun 18 16:52:20 RE1 catalina.sh: at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
Jun 18 16:52:20 RE1 catalina.sh: at java.util.concurrent.FutureTask.awaitDone(FutureTask.java:429)
Jun 18 16:52:20 RE1 catalina.sh: at java.util.concurrent.FutureTask.get(FutureTask.java:191)
Jun 18 16:52:20 RE1 catalina.sh: at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1016)

Jun 18 16:52:20 RE1 catalina.sh: "NioBlockingSelector.BlockPoller-1" #13 daemon prio=5 os_prio=0 tid=0x00007f5a0869f800 nid=0x121c8 runnable [0x00007f59ea3af000]
Jun 18 16:52:20 RE1 catalina.sh: java.lang.Thread.State: RUNNABLE
Jun 18 16:52:20 RE1 catalina.sh: at sun.nio.ch.EPollArrayWrapper.epollWait(Native Method)
Jun 18 16:52:20 RE1 catalina.sh: at sun.nio.ch.EPollArrayWrapper.poll(EPollArrayWrapper.java:269)

Jun 18 16:52:20 RE1 catalina.sh: "Service Thread" #8 daemon prio=9 os_prio=0 tid=0x00007f5a08135000 nid=0x121c4 runnable [0x0000000000000000]
Jun 18 16:52:20 RE1 catalina.sh: java.lang.Thread.State: RUNNABLE
Jun 18 16:52:20 RE1 catalina.sh: "C1 CompilerThread2" #7 daemon prio=9 os_prio=0 tid=0x00007f5a08122000 nid=0x121c3 waiting on condition [0x0000000000000000]

Jun 18 16:52:20 RE1 catalina.sh: "Reference Handler" #2 daemon prio=10 os_prio=0 tid=0x00007f5a080e0000 nid=0x121be in Object.wait() [0x00007f59ebdfc000]
Jun 18 16:52:20 RE1 catalina.sh: java.lang.Thread.State: WAITING (on object monitor)
Jun 18 16:52:20 RE1 catalina.sh: at java.lang.Object.wait(Native Method)
Jun 18 16:52:20 RE1 catalina.sh: - waiting on <0x00000000831fc2d8> (a java.lang.ref.Reference$Lock)
Jun 18 16:52:20 RE1 catalina.sh: at java.lang.Object.wait(Object.java:502)
Jun 18 16:52:20 RE1 catalina.sh: at java.lang.ref.Reference.tryHandlePending(Reference.java:191)
Jun 18 16:52:20 RE1 catalina.sh: - locked <0x00000000831fc2d8> (a java.lang.ref.Reference$Lock)
Jun 18 16:52:20 RE1 catalina.sh: at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:153)

Jun 18 16:52:20 RE1 catalina.sh: "main" #1 prio=5 os_prio=0 tid=0x00007f5a0804c000 nid=0x121b8 waiting on condition [0x00007f5a10cc5000]
Jun 18 16:52:20 RE1 catalina.sh: java.lang.Thread.State: WAITING (parking)
Jun 18 16:52:20 RE1 catalina.sh: at sun.misc.Unsafe.park(Native Method)
Jun 18 16:52:20 RE1 catalina.sh: - parking to wait for  <0x0000000082d0f1e8> (a java.util.concurrent.FutureTask)
Jun 18 16:52:20 RE1 catalina.sh: at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
Jun 18 16:52:20 RE1 catalina.sh: at java.util.concurrent.FutureTask.awaitDone(FutureTask.java:429)
Jun 18 16:52:20 RE1 catalina.sh: at java.util.concurrent.FutureTask.get(FutureTask.java:191)
Jun 18 16:52:20 RE1 catalina.sh: at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:917)

好的,問題出在類路徑上。Tomcat 不喜歡以冒號開頭。

前:

Using CLASSPATH:       :/opt/app/jasper/apache-tomcat-8.0.23/extra_cp/phoenix-shaded-4.4.0-HBase-1.1-1.jar:/opt/app/jasper/default/bin/bootstrap.jar:/opt/app/jasper/default/bin/tomcat-juli.jar

後:

Using CLASSPATH:       /opt/app/jasper/apache-tomcat-8.0.23/extra_cp/phoenix-shaded-4.4.0-HBase-1.1-1.jar:/opt/app/jasper/default/bin/bootstrap.jar:/opt/app/jasper/default/bin/tomcat-juli.jar

引用自:https://serverfault.com/questions/1022034