Spring boot项目启动后自动关闭问题的解决

问题描述

Spring boot项目用 java -jar xxx.jar > catalina.out 2>&1 & 命令启动后,无缘无故自动关闭,进程消失,日志如下:

[INFO ] 2018-04-15 22:10:25,829 method:org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:984)
Closing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@e2d56bf: startup date [Sun Apr 15 20:47:52 CST 2018]; root of context hierarchy
[INFO ] 2018-04-15 22:10:25,831 method:org.springframework.jmx.export.MBeanExporter.destroy(MBeanExporter.java:449)
Unregistering JMX-exposed beans on shutdown
[INFO ] 2018-04-15 22:10:25,837 method:org.springframework.jmx.support.MBeanRegistrationSupport.unregisterBeans(MBeanRegistrationSupport.java:241)
Unregistering JMX-exposed beans
[INFO ] 2018-04-15 22:10:25,844 method:com.alibaba.druid.pool.DruidDataSource.close(DruidDataSource.java:1383)
{dataSource-1} closed

解决办法

使用nohup java -jar xxx.jar > catalina.out 2>&1 &启动

你可能感兴趣的:(Java,Web)