tomcat自动停掉

tomcat自动停关闭


先阐述一下情况
最近项目再tomcat部署再linux上总是自动停止,一开始猜测可能是连接池没配好,因为出现过:一段时间没有访问,再去访问时就报错Connection reset,并且一直连不上,后来重新配置了连接池

// An highlighted block
#初始化连接数
jdbc.initialSize=5
#最小空闲连接数
jdbc.minidle = 80
#最大连接数
jdbc.maxactive = 100
#最大空闲连接数
jdbc.maxidle = 30
#获取连接最大等待时间
jdbc.maxwait = 20

jdbc.removeAbandonedTimeout=10
jdbc.removeAbandoned=true

还是没有用,大概两个小时就挂了,也没有什么特别的报错日志,只有一些销毁日志。
截取一个时间段的内存监控发现内存占用率一直在升高,知道tomcat自动停止,输出以下日志

logback 2020-09-17 12:05:02.499 INFO  --- [localhost-startStop-2] org.springframework.context.support.AbstractApplicationContext#doClose@1002 : Closing WebApplicationContext for namespace 'JeeCmsFront-servlet': startup date [Thu Sep 17 10:05:43 CST 2020]; parent: Root WebApplicationContext 
logback 2020-09-17 12:05:02.501 INFO  --- [localhost-startStop-2] org.springframework.beans.factory.support.DefaultSingletonBeanRegistry#destroySingletons@422 : Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@7cb3b99e: defining beans [...]
logback 2020-09-17 12:05:02.567 INFO  --- [localhost-startStop-2] org.springframework.context.support.AbstractApplicationContext#doClose@1002 : Closing WebApplicationContext for namespace 'flex-servlet': startup date [Thu Sep 17 10:05:35 CST 2020]; parent: Root WebApplicationContext 
logback 2020-09-17 12:05:02.568 INFO  --- [localhost-startStop-2] org.springframework.beans.factory.support.DefaultSingletonBeanRegistry#destroySingletons@422 : Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@18b6a0df: defining beans []; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory@18c554b0 
logback 2020-09-17 12:05:02.570 INFO  --- [localhost-startStop-2] org.springframework.context.support.AbstractApplicationContext#doClose@1002 : Closing WebApplicationContext for namespace 'JeeCmsAdmin-servlet': startup date [Thu Sep 17 10:05:36 CST 2020]; parent: Root WebApplicationContext 
logback 2020-09-17 12:05:02.571 INFO  --- [localhost-startStop-2] org.springframework.beans.factory.support.DefaultSingletonBeanRegistry#destroySingletons@422 : Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@50ac7fdd: defining beans [...]
logback 2020-09-17 12:05:02.981 INFO  --- [localhost-startStop-2] org.springframework.context.support.AbstractApplicationContext#doClose@1002 : Closing Root WebApplicationContext: startup date [Thu Sep 17 10:04:57 CST 2020]; root of context hierarchy 
logback 2020-09-17 12:05:02.985 INFO  --- [localhost-startStop-2] org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup#stop@345 : Stopping beans in phase 2147483647 
logback 2020-09-17 12:05:02.988 INFO  --- [localhost-startStop-2] org.quartz.core.QuartzScheduler#standby@496 : Scheduler startQuertz_$_NON_CLUSTERED paused. 
logback 2020-09-17 12:05:02.989 INFO  --- [localhost-startStop-2] org.springframework.beans.factory.support.DefaultSingletonBeanRegistry#destroySingletons@422 : Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@18c554b0: defining beans [...]root of factory hierarchy 
logback 2020-09-17 12:05:02.996 WARN  --- [localhost-startStop-2] org.springframework.beans.factory.support.DisposableBeanAdapter#destroy@193 : Invocation of destroy method failed on bean with name 'cmsSiteFlowCache': org.springframework.beans.factory.BeanCreationNotAllowedException: Error creating bean with name 'transactionManager': Singleton bean creation not allowed while the singletons of this factory are in destruction (Do not request a bean from a BeanFactory in a destroy method implementation!) 
logback 2020-09-17 12:05:02.997 WARN  --- [localhost-startStop-2] org.springframework.beans.factory.support.DisposableBeanAdapter#destroy@193 : Invocation of destroy method failed on bean with name 'contentCountCache': org.springframework.beans.factory.BeanCreationNotAllowedException: Error creating bean with name 'transactionManager': Singleton bean creation not allowed while the singletons of this factory are in destruction (Do not request a bean from a BeanFactory in a destroy method implementation!) 
logback 2020-09-17 12:05:02.997 INFO  --- [localhost-startStop-2] com.jeecms.common.web.WebEhCacheManagerFacotryBean#destroy@114 : Shutting down EHCache CacheManager 
logback 2020-09-17 12:05:03.013 INFO  --- [localhost-startStop-2] org.springframework.scheduling.quartz.SchedulerFactoryBean#destroy@760 : Shutting down Quartz Scheduler 
logback 2020-09-17 12:05:03.013 INFO  --- [localhost-startStop-2] org.quartz.core.QuartzScheduler#shutdown@570 : Scheduler startQuertz_$_NON_CLUSTERED shutting down. 
logback 2020-09-17 12:05:03.014 INFO  --- [localhost-startStop-2] org.quartz.core.QuartzScheduler#standby@496 : Scheduler startQuertz_$_NON_CLUSTERED paused. 
logback 2020-09-17 12:05:03.015 INFO  --- [localhost-startStop-2] org.quartz.core.QuartzScheduler#shutdown@621 : Scheduler startQuertz_$_NON_CLUSTERED shutdown complete. 
logback 2020-09-17 12:05:03.015 INFO  --- [localhost-startStop-2] org.springframework.flex.remoting.RemotingDestinationExporter#destroyDestination@157 : Removing remoting destination 'FormService' 
logback 2020-09-17 12:05:03.016 INFO  --- [localhost-startStop-2] org.springframework.orm.hibernate3.AbstractSessionFactoryBean#destroy@246 : Closing Hibernate SessionFactory 
logback 2020-09-17 12:05:03.016 INFO  --- [localhost-startStop-2] org.hibernate.impl.SessionFactoryImpl#close@853 : closing 
logback 2020-09-17 12:05:03.165 INFO  --- [localhost-startStop-2] org.springframework.flex.remoting.RemotingDestinationExporter#destroyDestination@157 : Removing remoting destination 'CToolBean' 
logback 2020-09-17 12:05:03.165 INFO  --- [localhost-startStop-2] org.springframework.flex.remoting.RemotingDestinationExporter#destroyDestination@157 : Removing remoting destination 'authenticationHelper' 

不知道是不是内存泄露,如果是,是不是连接池配置导致的,找不到理由阿,还是Hibernate获取连接池的时候没有正确的获取,因为我发现我们的项目中有地方用到了openSession() ,和种获取连接的方式,虽然主动关闭了 ,但是就不归连接池管理了吧,哎 反正我是没辙了 时间太短 也没有报错信息,不知道大神们有何高见。

猜你喜欢

转载自blog.csdn.net/weixin_45029496/article/details/108836841