启动后,Azure应用程序服务上的springboot应用程序立即停止

时间:2020-05-24 17:01:16

标签: java azure spring-boot azure-web-app-service

我在azure应用程序服务上有一个spring boot rest应用程序。每当我使用 azure DevOps管道或直接使用 azure-webapp-maven-plugin 部署应用程序时,部署都能成功进行,因为我可以在中看到所有上传的文件来自 Kudu调试控制台的站点/ wwwroot / webapps / ROOT 。当我尝试访问任何端点甚至应用程序URL时,它返回404(未找到错误)。 我拉起了日志,这就是我发现的东西。

[DEBUG] 2020-05-24 10:45:31,644 org.springframework.core.env.PropertySourcesPropertyResolver logKeyFound - - Found key 'spring.liveBeansView.mbeanDomain' in PropertySource 'servletContextInitParams' with value of type String
[INFO] 2020-05-24 10:45:31,660 com.company.product.core.MainApplication logStarted - - Started MainApplication in 37.424 seconds (JVM running for 65.143)
[DEBUG] 2020-05-24 10:45:32,347 org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext doClose - - Closing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@60d5a711, started on Sun May 24 10:44:58 GMT 2020
[DEBUG] 2020-05-24 10:45:32,378 org.springframework.core.env.PropertySourcesPropertyResolver logKeyFound - - Found key 'spring.liveBeansView.mbeanDomain' in PropertySource 'servletContextInitParams' with value of type String
[DEBUG] 2020-05-24 10:45:32,456 org.springframework.context.support.DefaultLifecycleProcessor stop - - Stopping beans in phase 2147483647
[DEBUG] 2020-05-24 10:45:32,456 org.springframework.context.support.DefaultLifecycleProcessor lambda$doStop$2 - - Bean 'documentationPluginsBootstrapper' completed its stop procedure
[DEBUG] 2020-05-24 10:45:32,456 org.springframework.jmx.export.annotation.AnnotationMBeanExporter destroy - - Unregistering JMX-exposed beans on shutdown
[DEBUG] 2020-05-24 10:45:32,456 org.springframework.jmx.export.annotation.AnnotationMBeanExporter unregisterBeans - - Unregistering JMX-exposed beans
[INFO] 2020-05-24 10:45:32,456 org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor shutdown - - Shutting down ExecutorService 'applicationTaskExecutor'

应用程序在初始化后立即关闭。在我看来,好像应用程序服务正在向Spring Boot应用程序发送关闭命令。 有人可以帮忙吗?我按时按了。预先感谢。

1 个答案:

答案 0 :(得分:0)

通常,我们使用jar文件将spring boot应用程序部署到Azure Web应用程序。步骤如下:

1。转到门户网站->配置->检查Java容器中的Web应用程序。我们将使用Java SE代替Tomcat。

enter image description here

2。在门户->“高级工具”->“调试控制台”->“ Cmd”中转到您的Web应用。将您的jar文件放在wwwroot文件夹下。需要将其命名为app.jar。

3。结果

enter image description here

enter image description here