首页 > 解决方案 > Springboot 应用程序未在现有 tomcat 上完全启动

问题描述

我有一个可用的 springboot 应用程序,构建在 java 1.8 中

我按照 springboot 文档创建了一个战争,并将其部署在 Tomcat 服务器中。

我在本地成功启动并测试了 IntelliJ 中的应用程序:

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.1.6.RELEASE)

2019-08-13 14:44:07.801  INFO 10824 --- [on(3)-127.0.0.1] com.oaa.cos.web.Application         : Starting Application v0.0.33-SNAPSHOT on NBL000197 with PID 10824 (C:\Users\10067726\Documents\apache-tomcat-9.0.22\webapps\cosw\WEB-INF\classes started by 10067726 in C:\Users\10067726\Documents\apache-tomcat-9.0.22\bin)
2019-08-13 14:44:07.841  INFO 10824 --- [on(3)-127.0.0.1] com.oaa.cos.web.Application         : No active profile set, falling back to default profiles: default
2019-08-13 14:44:14.017  INFO 10824 --- [on(3)-127.0.0.1] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 5885 ms
13-Aug-2019 14:44:18.011 AVERTISSEMENT [RMI TCP Connection(3)-127.0.0.1] javax.xml.soap.FactoryFinder.find Using deprecated META-INF/services mechanism with non-standard property: javax.xml.soap.MetaFactory. Property javax.xml.soap.SAAJMetaFactory should be used instead.
2019-08-13 14:44:26.385  INFO 10824 --- [on(3)-127.0.0.1] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
2019-08-13 14:44:27.240  INFO 10824 --- [on(3)-127.0.0.1] o.s.b.a.w.s.WelcomePageHandlerMapping    : Adding welcome page template: index
2019-08-13 14:44:27.687  INFO 10824 --- [on(3)-127.0.0.1] com.oaa.cos.web.Application         : Started Application in 23.395 seconds (JVM running for 49.022)

我想在现有服务器上部署战争,在现有服务器实例中,已经为其他战争工作。

当启动实例时,它似乎在结束之前停止......

它永远不会结束,应用程序没有响应:

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.1.6.RELEASE)

2019-08-13 14:53:34.993  INFO 11239 --- [           main] com.oaa.cos.web.Application         : Starting Application v0.0.33-SNAPSHT on dfrlmasoatc01.int.com with PID 11239 (/home1/tomcat9-multiharden/instances/default/webapps/EdgeCustomerOfferStorageWeb/WEB-INFclasses started by tomcat9 in /)
2019-08-13 14:53:35.005  INFO 11239 --- [           main] com.oaa.cos.web.Application         : No active profile set, falling backto default profiles: default
2019-08-13 14:53:36.659  INFO 11239 --- [           main] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialzation completed in 1591 ms

我已经检查了以下几点:

我怎么知道这一步之后发生了什么以及为什么我的应用程序没有真正部署?如何访问 tomcat 管理器界面?您真的认为可以部署应用程序并且不完整的日志可能会让我错吗?

标签: javaspring-boottomcat

解决方案


我发现了问题。将日志级别放入我的实例的 setenv.sh 中:-Dlogging.level.org.springframework=DEBUG

我看到应用程序等待特定的 bean 创建。在我的例子中,这个 bean 为一个 wsdl url 实例化了一个肥皂客户端。url 不正确,因此 bean 无法连接到它。

但是有一件事我不明白:为什么tomcat没有默认超时或错误?为什么以前可以部署的同一实例中的另一场战争无法正常工作?Tomcat 会阻止实例中的每个应用程序,而其中一个应用程序无法部署?


推荐阅读