问题描述
小弟新接手了一个系统,unix+tomcat5.5+mysqltomcat5启动后3小时左右总会无故死掉,请各位javaeyer帮忙看下,有思路的话,我可以提供详细log环境变量:# ./shutdown.shUsing CATALINA_BASE: /opt/tomcat5Using CATALINA_HOME: /opt/tomcat5Using CATALINA_TMPDIR: /opt/tomcat5/tempUsing JRE_HOME: /usr/javaUsing CLASSPATH: /opt/tomcat5/bin/bootstrap.jar# ./startup.shUsing CATALINA_BASE: /opt/tomcat5Using CATALINA_HOME: /opt/tomcat5Using CATALINA_TMPDIR: /opt/tomcat5/tempUsing JRE_HOME: /usr/javaUsing CLASSPATH: /opt/tomcat5/bin/bootstrap.jar关闭log:Oct 21, 2010 9:49:56 AM org.apache.coyote.http11.Http11BaseProtocol pauseINFO: Pausing Coyote HTTP/1.1 on http-8080Oct 21, 2010 9:49:57 AM org.apache.catalina.core.StandardService stopINFO: Stopping service Catalina2010-10-21 09:49:57,703 - org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/ReportManager] INFO - Closing Spring root WebApplicationContext2010-10-21 09:49:57,704 - org.springframework.web.context.support.XmlWebApplicationContext INFO - Closing org.springframework.web.context.support.XmlWebApplicationContext@5a3923: display name [Root WebApplicationContext]; startup date [Thu Oct 21 08:52:54 CST 2010]; root of context hierarchy2010-10-21 09:49:57,706 - org.quartz.core.QuartzScheduler INFO - Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED paused.2010-10-21 09:49:57,707 - org.springframework.beans.factory.support.DefaultListableBeanFactory INFO - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@fe315d: defining beans [quartzManager,autoGenerateFileJob,DoxFileOut,autoAccuracyRateJob,autoAccuracyRateOut,autoWorkLoadJob,autoWorkLoadOut,autoResourcesWorkLoadJob,autoResourcesWorkLoadOut,resourcePipeJob,TrafficResourcePipeTrigger,ResourceOpticalCableJob,TrafficResourceOpticalCableTrigger,ResourceFiberJob,TrafficResourceFiberTrigger,ResourceCircuitJob,TrafficResourceCircuitTrigger,ResourceCircuitClassJob,TrafficResourceCircuitClassTrigger,ResourceNetUsageJob,TrafficResourceNetUsageTrigger,ResourceVendorJob,TrafficResourceVendorTrigger,dataSource4tnms,multiDataSource,mysqlSessionFactory,transactionManager,transactionInterceptor,org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator#0,InformixBaseService,mysqlBaseService,com.boco.common.util.MyApplicationContextUtil#0,baseAction,userLogger,webUtils,userDao,systemDao,reportCommonDao,reportCommonDao_Local,reportCommonGroupDao,actionManageDao,report4MulitRecordDao,report4MulitRecordDao_Local,linkReportDao_Local,reportCommonService,report4MulitRecordService,/loginAction,/systemAction,/userLogAction,/regionManageAction,/userManageAction,/menuManageAction,/privilegeManageAction,/reportCommonAction,/exportExcelAction,/report4MulitRecordAction,/reportCommonActionFiber,/ReportCommonActionPipeRes,reportpiperesource,autoResourcePipeReport,autoResourceOpticalCableReport,autoResourceFiberReport,autoResourceCircuitReport,autoResourceCircuitClassReport,autoResourceNetUsageReport,autoResourceVendorReport,autoResource,auto<script type="text/javascript" src="http://www.iteye.com/javascripts/tinymce/themes/advanced/langs/zh.js"></script><script type="text/javascript" src="http://www.iteye.com/javascripts/tinymce/plugins/javaeye/langs/zh.js"></script>Factory,autoMonthlyFactory,autoTrafficQualityMonthlyBaseDataReport,autoTrafficQualityMonthlyNetFaultReport,autoTrafficQualityMonthlyFaultEffectReport,dataSource4nmosdb,alarmReportDao,alarmReportDao_Local,alarmReportService,/alarmReportAction,quartzJob,jobtask,doTime,startQuertz,statementManagementBean]; root of factory hierarchy2010-10-21 09:49:57,722 - org.springframework.scheduling.quartz.SchedulerFactoryBean INFO - Shutting down Quartz Scheduler2010-10-21 09:49:57,722 - org.quartz.core.QuartzScheduler INFO - Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED shutting down.2010-10-21 09:49:57,723 - org.quartz.core.QuartzScheduler INFO - Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED paused.2010-10-21 09:49:57,734 - org.quartz.core.QuartzScheduler INFO - Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED shutdown complete.2010-10-21 09:49:57,740 - org.springframework.orm.hibernate3.LocalSessionFactoryBean INFO - Closing Hibernate SessionFactory2010-10-21 09:49:57,741 - org.hibernate.impl.SessionFactoryImpl INFO - closing2010-10-21 09:49:57,764 - org.springframework.scheduling.quartz.SchedulerFactoryBean INFO - Shutting down Quartz Schedulerlog4j:ERROR LogMananger.repositorySelector was null likely due to error in class reloading, using NOPLoggerRepository.Oct 21, 2010 9:49:59 AM org.apache.coyote.http11.Http11BaseProtocol destroyINFO: Stopping Coyote HTTP/1.1 on http-8080Oct 21, 2010 9:49:59 AM org.apache.catalina.core.AprLifecycleListener lifecycleEventINFO: Failed shutdown of Apache Portable Runtime启动log:Oct 21, 2010 9:51:35 AM org.apache.catalina.core.AprLifecycleListener lifecycleEventINFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/jre/lib/sparc/server:/usr/java/jre/lib/sparc:/usr/java/jre/../lib/sparc:/usr/jdk/packages/lib/sparc:/lib:/usr/libOct 21, 2010 9:51:35 AM org.apache.coyote.http11.Http11BaseProtocol initINFO: Initializing Coyote HTTP/1.1 on http-8080Oct 21, 2010 9:51:35 AM org.apache.catalina.startup.Catalina loadINFO: Initialization processed in 2750 msOct 21, 2010 9:51:35 AM org.apache.catalina.core.StandardService startINFO: Starting service CatalinaOct 21, 2010 9:51:35 AM org.apache.catalina.core.StandardEngine startINFO: Starting Servlet Engine: Apache Tomcat/5.5.28Oct 21, 2010 9:51:36 AM org.apache.catalina.core.StandardHost startINFO: XML validation disabledOct 21, 2010 9:51:38 AM org.apache.catalina.startup.HostConfig deployWARINFO: Deploying web application archive ReportManager.warOct 21, 2010 9:51:39 AM org.apache.catalina.loader.WebappClassLoader validateJarFileINFO: validateJarFile(/opt/tomcat5/webapps/ReportManager/WEB-INF/lib/javax.servlet.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.classOct 21, 2010 9:51:39 AM org.apache.catalina.loader.WebappClassLoader validateJarFileINFO: validateJarFile(/opt/tomcat5/webapps/ReportManager/WEB-INF/lib/javax.servlet.jsp.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/jsp/JspPage.class2010-10-21 09:51:40,407 - org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/ReportManager] INFO - Initializing Spring root WebApplicationContext2010-10-21 09:51:40,414 - org.springframework.web.context.ContextLoader INFO - Root WebApplicationContext: initialization started2010-10-21 09:51:40,599 - org.springframework.web.context.support.XmlWebApplicationContext INFO - Refreshing org.springframework.web.context.support.XmlWebApplicationContext@676e3f: display name [Root WebApplicationContext]; startup date [Thu Oct 21 09:51:40 CST 2010]; root of context hierarchy2010-10-21 09:52:02,531 - org.quartz.core.QuartzScheduler INFO - JobFactory set to: org.springframework.scheduling.quartz.AdaptableJobFactory@192563a2010-10-21 09:52:02,535 - org.springframework.scheduling.quartz.SchedulerFactoryBean INFO - Starting Quartz Scheduler now2010-10-21 09:52:02,536 - org.quartz.core.QuartzScheduler INFO - Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED started.2010-10-21 09:52:02,537 - org.springframework.web.context.ContextLoader INFO - Root WebApplicationContext: initialization completed in 22122 ms2010-10-21 09:52:02,541 - com.boco.framework.common.AppListener INFO - ReportManager started!Oct 21, 2010 9:52:04 AM org.apache.catalina.core.StandardContext startSEVERE: Error filterStartOct 21, 2010 9:52:04 AM org.apache.catalina.core.StandardContext startSEVERE: Context [/servlets-examples] startup failed due to previous errorsOct 21, 2010 9:52:05 AM org.apache.coyote.http11.Http11BaseProtocol startINFO: Starting Coyote HTTP/1.1 on http-8080Oct 21, 2010 9:52:05 AM org.apache.jk.common.ChannelSocket initINFO: JK: ajp13 listening on /0.0.0.0:8009Oct 21, 2010 9:52:05 AM org.apache.jk.server.JkMain startINFO: Jk running ID=0 time=0/93 config=nullOct 21, 2010 9:52:06 AM org.apache.catalina.storeconfig.StoreLoader loadINFO: Find registry server-registry.xml at classpath resourceOct 21, 2010 9:52:06 AM org.apache.catalina.startup.Catalina startINFO: Server startup in 30837 ms急...... 问题补充:<div class="quote_title">dwbin 写道</div><div class="quote_div">这些日志没用啊,估计内存爆掉了吧,直接把jvm给down了,看看logs目录下面有没有别的东西?</div><br />内存正常,不超过1.2%
解决方案
你看一下tomcat挂掉之前的后台日志(不是你提供的log,是命令行中给的异常信息),有没有out of memory异常,同时看一下tomcat挂掉后,访问前台页面是什么结果,能访问但出错还是没有反应。如果是out of memory,可以增加tomcat启动参数,在%tomcat%/bin/catalina.bat文件中,在rem Guess CATALINA_HOME if not defined后面增加"set JAVA_OPTS=-Xms256m -Xmx512m -XX:+PerfBypassFileSystemCheck”,提升tomcat可使用的内存大小。
解决方案二:
之前我也遇到过同样的问题,可能和系统有关吧 尝试换下系统或者从做下系统看看呢
解决方案三:
如果是out of memory,tomcat 6也会有同样的问题,你也可以用上面的方法修改:)
解决方案四:
之前遇到过类似的问题,tomcat5.5好像是存在bug,后来直接更换了tomcat6.0,这个问题就不存在了。建议更换版本试试。
解决方案五:
看你的启动日子能看出什么呢,我最近用了个TOMACAT,过段时间直接CORE掉了,内存用完了吧,在bin目录里产生了几个core文件,用工具分析了,原来是堆栈满了。你可以看看有没有core掉。
解决方案六:
这些日志没用啊,估计内存爆掉了吧,直接把jvm给down了,看看logs目录下面有没有别的东西?