编程语言
首页 > 编程语言> > 为什么我的Spring Boot应用程序首先失败,然后突然在cloudfoundry中启动?

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

作者:互联网

我们刚刚将我们的四个应用程序迁移到了Spring Boot 1.4,而三个应用程序运行良好.
第4个是唯一带有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)进行了测试,它显示了完全相同的问题.

解决方法:

这是tomcat 8.5.4 https://github.com/spring-projects/spring-boot/issues/6657的不兼容问题

标签:cloudfoundry,spring-boot,tomcat,spring
来源: https://codeday.me/bug/20191118/2027034.html