为什么我的春季启动应用程序首先失败然后突然在cloudfoundry中启动?

时间:2016-08-15 18:54:00

标签: spring tomcat spring-boot cloudfoundry

我们刚刚将四个应用程序迁移到spring boot 1.4和3个正常运行。 第四个是唯一一个使用WAR打包并包含JSP的人。这个行为有一个非常奇怪的行为:我们推动它,然后它会自动失败两次启动,然后当CF第三次启动时启动它。以前有没有人听过这个?我真的没有想法。

要明确:我只推送应用程序,然后cloudfoundry会处理其他所有事情。它尝试启动应用程序四次,直到它突然成功。我不会以任何其他方式停止或启动应用程序。此外,当我们通过CF GUI停止并启动应用程序时,会发生同样的事情,而不会在之前进行推送...

2016-08-15T20:01:14.06+0200 [APP/0]      OUT 18:01:14.063 [Tomcat-startStop-1] ERROR o.apache.catalina.core.ContainerBase - A child container failed during start
2016-08-15T20:01:14.06+0200 [APP/0]      OUT java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
2016-08-15T20:01:14.06+0200 [APP/0]      OUT    at java.util.concurrent.FutureTask.report(FutureTask.java:122)
2016-08-15T20:01:14.06+0200 [APP/0]      OUT    at java.util.concurrent.FutureTask.get(FutureTask.java:192)
2016-08-15T20:01:14.06+0200 [APP/0]      OUT    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:911)
2016-08-15T20:01:14.06+0200 [APP/0]      OUT    at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:890)
2016-08-15T20:01:14.06+0200 [APP/0]      OUT    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:152)
2016-08-15T20:01:14.06+0200 [APP/0]      OUT    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1403)
2016-08-15T20:01:14.06+0200 [APP/0]      OUT    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1393)
2016-08-15T20:01:14.06+0200 [APP/0]      OUT    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
2016-08-15T20:01:14.06+0200 [APP/0]      OUT    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
2016-08-15T20:01:14.06+0200 [APP/0]      OUT    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
2016-08-15T20:01:14.06+0200 [APP/0]      OUT    at java.lang.Thread.run(Thread.java:745)
2016-08-15T20:01:14.06+0200 [APP/0]      OUT Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
2016-08-15T20:01:14.06+0200 [APP/0]      OUT    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:158)
2016-08-15T20:01:14.06+0200 [APP/0]      OUT    ... 6 common frames omitted
2016-08-15T20:01:14.06+0200 [APP/0]      OUT Caused by: java.lang.NullPointerException: null
2016-08-15T20:01:14.06+0200 [APP/0]      OUT    at org.apache.tomcat.util.scan.StandardJarScanner.process(StandardJarScanner.java:325)
2016-08-15T20:01:14.06+0200 [APP/0]      OUT    at org.apache.tomcat.util.scan.StandardJarScanner.scan(StandardJarScanner.java:182)
2016-08-15T20:01:14.06+0200 [APP/0]      OUT    at org.apache.jasper.servlet.TldScanner.scanJars(TldScanner.java:262)
2016-08-15T20:01:14.06+0200 [APP/0]      OUT    at org.apache.jasper.servlet.TldScanner.scan(TldScanner.java:104)
2016-08-15T20:01:14.06+0200 [APP/0]      OUT    at org.apache.jasper.servlet.JasperInitializer.onStartup(JasperInitializer.java:103)
2016-08-15T20:01:14.06+0200 [APP/0]      OUT    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5167)
2016-08-15T20:01:14.06+0200 [APP/0]      OUT    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:152)
2016-08-15T20:01:14.06+0200 [APP/0]      OUT    ... 6 common frames omitted

完整日志,请参阅:http://pastebin.com/6pqtbH7F

编辑:我刚刚使用Spring Boot JSP示例(https://github.com/spring-projects/spring-boot/tree/master/spring-boot-samples/spring-boot-sample-tomcat-jsp)进行了测试,它显示了完全相同的问题。

2 个答案:

答案 0 :(得分:3)

这是与tomcat 8.5.4 https://github.com/spring-projects/spring-boot/issues/6657

的不兼容问题

答案 1 :(得分:0)

鉴于您发布的完整日志,您的应用程序似乎已耗尽CF上的资源。你能发布以下命令的输出:

cf events <app name>