2016-03-09 81 views
0

我使用java -jar xxx.jar开始我的Spring Boot web应用程序,但运行了一段时间后,应用程序自行关闭。这里是--debug登录为什么我的Spring Boot应用程序本身关闭

22:55:36.187 [http-nio-7082-exec-10] DEBUG o.s.web.servlet.DispatcherServlet - Successfully completed request 
22:55:36.187 [http-nio-7082-exec-10] DEBUG o.s.b.c.w.OrderedRequestContextFilter - Cleared thread-bound request context: [email protected] 
01:06:52.227 [Thread-4] INFO o.s.b.c.e.AnnotationConfigEmbeddedWebApplicationContext - Closing org.springframework.boot[email protected]633761b6: startup date [Tue Mar 08 22:54:54 CST 2016]; root of context hierarchy 
01:06:52.229 [Thread-4] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'lifecycleProcessor' 
01:06:52.229 [Thread-4] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Destroying singletons in org.s[email protected]2db493c7: defining beans [......]; root of factory hierarchy 
01:06:52.234 [Thread-4] DEBUG o.s.b.f.s.DisposableBeanAdapter - Invoking destroy() on bean with name 'mbeanExporter' 
01:06:52.234 [Thread-4] INFO o.s.j.e.a.AnnotationMBeanExporter - Unregistering JMX-exposed beans on shutdown 
01:06:52.238 [Thread-4] DEBUG o.s.b.f.s.DisposableBeanAdapter - Invoking destroy() on bean with name 'mvcValidator' 
01:06:52.242 [Thread-4] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Retrieved dependent beans for bean '(inner bean)#62a4e999': [tzsUserDao] 
01:06:52.242 [Thread-4] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Retrieved dependent beans for bean '(inner bean)#38e46e67': [(inner bean)#62a4e999] 
01:06:52.243 [Thread-4] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Retrieved dependent beans for bean '(inner bean)#7a25d5eb': [tzsUserActionDao] 
01:06:52.243 [Thread-4] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Retrieved dependent beans for bean '(inner bean)#2298ca79': [(inner bean)#7a25d5eb] 
01:06:52.244 [Thread-4] DEBUG o.s.b.f.s.DisposableBeanAdapter - Invoking destroy() on bean with name 'jpaMappingContext' 
01:06:52.244 [Thread-4] DEBUG o.s.b.f.s.DisposableBeanAdapter - Invoking destroy() on bean with name 'entityManagerFactory' 
01:06:52.245 [Thread-4] INFO o.s.o.j.LocalContainerEntityManagerFactoryBean - Closing JPA EntityManagerFactory for persistence unit 'default' 
01:06:52.245 [Thread-4] DEBUG o.h.internal.SessionFactoryImpl - HHH000031: Closing 
01:06:52.245 [Thread-4] DEBUG o.h.s.i.AbstractServiceRegistryImpl - Implicitly destroying ServiceRegistry on de-registration of all child ServiceRegistries 
01:06:52.246 [Thread-4] DEBUG o.h.b.r.i.BootstrapServiceRegistryImpl - Implicitly destroying Boot-strap registry on de-registration of all child ServiceRegistries 
01:06:52.246 [Thread-4] DEBUG o.h.j.i.EntityManagerFactoryRegistry - Remove: name=default 
01:06:52.246 [Thread-4] DEBUG o.s.b.f.s.DisposableBeanAdapter - Invoking destroy() on bean with name 'httpPutFormContentFilter' 
01:06:52.246 [Thread-4] DEBUG o.s.b.f.s.DisposableBeanAdapter - Invoking destroy() on bean with name 'hiddenHttpMethodFilter' 
01:06:52.247 [Thread-4] DEBUG o.s.b.f.s.DisposableBeanAdapter - Invoking destroy() on bean with name 'requestContextFilter' 
01:06:52.248 [Thread-4] DEBUG o.s.b.f.s.DisposableBeanAdapter - Invoking destroy() on bean with name 'characterEncodingFilter' 
01:06:52.249 [Thread-4] DEBUG o.s.b.f.s.DisposableBeanAdapter - Invoking destroy method 'close' on bean with name 'dataSource' 
01:06:52.254 [Thread-4] DEBUG o.s.b.f.s.DisposableBeanAdapter - Invoking destroy() on bean with name 'org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor' 
+0

看看这个,也许它是一个类似的问题:http://stackoverflow.com/questions/22380119/why-my-spring-boot-app-always-shutdown?rq=1 –

+0

看着其他堆栈溢出问题:您应该添加代码(或其中的一部分),否则很难理解出现问题的原因或通常情况下问题的上下文。 –

+0

通过'Thread-4'判断,我猜测这是关闭应用程序上下文的JVM关闭挂钩。这意味着有人要求JVM关闭。没有更多的信息是不可能的。如果你在Linux上运行,它可能是OOM Killer,尽管我不知道它是否发送了'SIGTERM',它将运行所有关闭钩子,或者'SIGKILL'不会。 –

回答

2

我知道为什么:因为我使用

java -jar xxx.jar 

开始我的春天启动web应用程序,但是当我通过

nohup java -jar xxx.jar 

来运行应用程序启动正确并且在SSH会话终止时不会被终止。

相关问题