java - 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
我已经检查了以下几点:
- 我的应用程序扩展了 SpringBootServletInitializer
- 我把starter tomcat依赖项放在provided中
- 战争名为“EdgeCustomerOfferStorageWeb.war”,实例端口为10080,所以我使用:http://server:10080/EdgeCustomerOfferStorageWeb/ 它没有响应,它永远不会结束加载。Servlet 是 3.+,所以不需要 web.xml
我怎么知道这一步之后发生了什么以及为什么我的应用程序没有真正部署?如何访问 tomcat 管理器界面?您真的认为可以部署应用程序并且不完整的日志可能会让我错吗?
解决方案
我发现了问题。将日志级别放入我的实例的 setenv.sh 中:-Dlogging.level.org.springframework=DEBUG
我看到应用程序等待特定的 bean 创建。在我的例子中,这个 bean 为一个 wsdl url 实例化了一个肥皂客户端。url 不正确,因此 bean 无法连接到它。
但是有一件事我不明白:为什么tomcat没有默认超时或错误?为什么以前可以部署的同一实例中的另一场战争无法正常工作?Tomcat 会阻止实例中的每个应用程序,而其中一个应用程序无法部署?
推荐阅读
- asp.net - 反序列化后显示json数据的问题
- r - R:有条件地将数据从列复制到行
- c# - 如何遍历文件夹并更新 XML 文件
- javascript - 使用嵌套对象的默认对象解构
- php - 如何限制新用户角色只能访问常规帖子,而不是自定义帖子类型?
- javascript - 表单中 Kendo Grid 中的下拉菜单 > 添加新记录创建未初始化的单元格
- javascript - 为什么我们需要通过 Svelte 中的 'detail' 对象来访问自定义的 Event 数据?
- list - Python - 如何获取列表中字典的值(即列表)?
- git - 添加新的远程,每次拉取都会创建新的合并提交
- json - 如何在网站更新时更新我的数据?