嵌入式 Tomcat 在开始部署应用程序时挂起

Embedded Tomcat hangs when starting on deploying app

我的嵌入式 tomcat 在仅在 Linux 上添加 webapp 时挂起。它不会在我第一次启动时发生,但 从第二次启动后

只有升级到 Tomcat 8 后才会发生这种情况。

进行线程转储时,我发现它在尝试检查访问时卡住了。

有什么想法吗?

"Thread-0@4521" prio=5 tid=0xb nid=NA runnable
  java.lang.Thread.State: RUNNABLE
                  at java.io.UnixFileSystem.checkAccess(UnixFileSystem.java:-1)
                  at java.io.File.canRead(File.java:768)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1992)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1988)
                  at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1939)
                  at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1897)
                  at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1149)
                  at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:771)
                  - locked <0x11c0> (a org.apache.catalina.startup.ContextConfig)
                  at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:305)
                  at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:95)
                  at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
                  at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5080)
                  - locked <0x11c1> (a org.apache.catalina.core.StandardContext)
                  at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
                  at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
                  at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
                  at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
                  at org.apache.catalina.startup.Tomcat.addWebapp(Tomcat.java:550)
                  at org.apache.catalina.startup.Tomcat.addWebapp(Tomcat.java:515)
                  at org.apache.catalina.startup.Tomcat.addWebapp(Tomcat.java:197)
                  at com.my.app.deployment.WebAppsDeployer.loadApplications(WebAppsDeployer.java:51)
                    *****my code****
                  at java.lang.Thread.run(Thread.java:745)

向 Apache 提交了一个错误,那里的人帮我找到了 solution