Java Tomcat 7未经通知就停机。请回答关键问题

Java Tomcat 7未经通知就停机。请回答关键问题,java,hibernate,spring-mvc,tomcat7,Java,Hibernate,Spring Mvc,Tomcat7,我正在使用Tomcat7部署我的应用程序 Tomcat随机停机,需要我一次又一次地重新启动服务器以保持其正常运行 有时,当我重新启动时,我会检查日志,查看是否正在等待实例被释放 其他时候,当我重新启动时,我会得到错误1053 我尝试删除我的临时/工作文件夹。我通过hibernate检查了我的数据库连接,我确保在tomcat下的lib中有所有必需的jar 我部署的方式是将我的war文件及其相应的应用程序文件夹复制到Tomcat下的Webapps中。请告诉我需要做什么来保持服务器稳定 另一个重要的注

我正在使用Tomcat7部署我的应用程序

Tomcat随机停机,需要我一次又一次地重新启动服务器以保持其正常运行

有时,当我重新启动时,我会检查日志,查看是否正在等待实例被释放

其他时候,当我重新启动时,我会得到错误1053

我尝试删除我的临时/工作文件夹。我通过hibernate检查了我的数据库连接,我确保在tomcat下的lib中有所有必需的jar

我部署的方式是将我的war文件及其相应的应用程序文件夹复制到Tomcat下的Webapps中。请告诉我需要做什么来保持服务器稳定

另一个重要的注意事项是,下面日志中的异常从Nullpointer更改为非法状态异常

任何有助于确定根本原因的帮助都将得到真正的赞赏,因为这是一个迫在眉睫的关键问题,尽管尝试了不同的解决方案,但一直困扰着我们

我的日志如下

    INFO: Waiting for 3 instance(s) to be deallocated
    Jan 27, 2014 2:17:27 PM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
    SEVERE: The web application [/cep4] registered the JDBC driver       [oracle.jdbc.OracleDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
Jan 27, 2014 2:17:27 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/cep4] appears to have started a thread named [Timer-0] but has failed to stop it. This is very likely to create a memory leak.
Jan 27, 2014 2:17:27 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/cep4] is still processing a request that has yet to finish. This is very likely to create a memory leak. You can control the time allowed for requests to finish by using the unloadDelay attribute of the standard Context implementation.
Jan 27, 2014 2:17:27 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/cep4] created a ThreadLocal with key of type [org.springframework.core.NamedThreadLocal] (value [Locale context]) and a value of type [org.springframework.web.servlet.DispatcherServlet$1] (value [en_US]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
Jan 27, 2014 2:17:27 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/cep4] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@1655d52d]) and a value of type [org.springframework.security.core.context.SecurityContextImpl] (value [org.springframework.security.core.context.SecurityContextImpl@388100c: Authentication: org.springframework.security.cas.authentication.CasAuthenticationToken@388100c: Principal: com.java.service.MyUserDetails@9154e84; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@ffff4c9c: RemoteIpAddress: 128.32.111.117; SessionId: CF331A8C27CEA68FAC797ED7E0E654B5; Granted Authorities: com.java.service.MyUserDetails$1@1aca2c25 Assertion: org.jasig.cas.client.validation.AssertionImpl@1a6d280b Credentials (Service/Proxy Ticket): ST-89206-bOamLKnOoLTLDJoIxYqs-cas-p3]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
Jan 27, 2014 2:17:27 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/cep4] created a ThreadLocal with key of type [org.springframework.core.NamedThreadLocal] (value [Request attributes]) and a value of type [org.springframework.web.context.request.ServletRequestAttributes] (value [SecurityContextHolderAwareRequestWrapper[ org.springframework.security.web.savedrequest.SavedRequestAwareWrapper@5d1e88cf]]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
Jan 27, 2014 2:17:27 PM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["http-bio-80"]
Jan 27, 2014 2:17:27 PM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["http-bio-8443"]
Jan 27, 2014 2:17:27 PM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["ajp-bio-8009"]
Jan 27, 2014 2:17:27 PM org.apache.catalina.loader.WebappClassLoader loadClass
INFO: Illegal access: this web application instance has been stopped already.  Could not load org.hibernate.cfg.ImprovedNamingStrategy.  The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
java.lang.IllegalStateException
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1600)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
    at org.springframework.util.ClassUtils.forName(ClassUtils.java:258)
    at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:417)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1283)
    at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1254)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:433)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:270)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:120)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1360)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)

    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

Jan 27, 2014 2:17:29 PM org.apache.catalina.startup.SetAllPropertiesRule begin
WARNING: [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'maxSpareThreads' to '75' did not find a matching property.
Jan 27, 2014 2:17:29 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:cep4' did not find a matching property.
Jan 27, 2014 2:17:29 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-80"]
Jan 27, 2014 2:17:29 PM org.apache.coyote.AbstractProtocol init

实际上,当使用ApacheTomcat7作为应用服务器时,我和我的同事面临着一个类似的问题,错误日志几乎相同。最后,我们可以利用网站上的内容来解决这个问题。在这里,我想以一步一步的方式分享我们的调试经验:

  • 尝试找出由于服务器时间导致的崩溃时间
  • 转到Tomcat的日志文件夹,在崩溃时间结束前检查错误
  • 尝试找出每个错误的原因,并尝试解决导致错误的问题
  • 使用可用的命令开始监视Tomcat的行为。我们使用了jConsole,但别忘了将jConsole转换为Tomcat
  • 尝试控制重要的参数,如线程和的更改,尤其是在使用系统的高峰期。可能您必须增加或的指定值或默认值。
    注意:PS幸存者空间上不要惊慌!大部分时间都是这样 最后一句话 最后,在我们的例子中,通过使用jConsole监视Tomcat,我们发现问题是
    峰值时间堆内存不足。解决方案是增加Tomcat分配的堆内存量。

    类似的问题:这些日志看起来像是标准关机的结束。有趣的是在那之前发生了什么。您需要先显示正常操作,然后再开始关机程序。@MarkThomas:这是正常操作下的Catalina.out日志。你们能给我一些指导吗?需要一些认真的帮助吗?现在仍然是unresolved@Evgeni无法从链接中获得太多帮助。请用特定的解决方案回复以帮助修复ma问题