Tomcat启动报错信息如下:
严重: Error listenerStart
2018-6-26 12:18:18 org.apache.catalina.core.StandardContext start
严重: Context [/demo] startup failed due to previous errors
2018-6-26 12:18:18 org.quartz.core.QuartzScheduler standby
信息: Scheduler org.springframework.scheduling.quartz.SchedulerFactoryBean#0_$_NON_CLUSTERED paused.
2018-6-26 12:18:18 org.quartz.core.QuartzScheduler shutdown
信息: Scheduler org.springframework.scheduling.quartz.SchedulerFactoryBean#0_$_NON_CLUSTERED shutting down.
2018-6-26 12:18:18 org.quartz.core.QuartzScheduler standby
信息: Scheduler org.springframework.scheduling.quartz.SchedulerFactoryBean#0_$_NON_CLUSTERED paused.
2018-6-26 12:18:18 org.quartz.core.QuartzScheduler shutdown
信息: Scheduler org.springframework.scheduling.quartz.SchedulerFactoryBean#0_$_NON_CLUSTERED shutdown complete.
2018-6-26 12:18:18 org.hibernate.impl.SessionFactoryImpl close
信息: closing
2018-6-26 12:18:18 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
严重: The web application [/demo] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
2018-6-26 12:18:18 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/demo] appears to have started a thread named [org.springframework.scheduling.quartz.SchedulerFactoryBean#0_Worker-1] but has failed to stop it. This is very likely to create a memory leak.
2018-6-26 12:18:18 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/demo] appears to have started a thread named [org.springframework.scheduling.quartz.SchedulerFactoryBean#0_Worker-2] but has failed to stop it. This is very likely to create a memory leak.
2018-6-26 12:18:18 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/demo] appears to have started a thread named [org.springframework.scheduling.quartz.SchedulerFactoryBean#0_Worker-3] but has failed to stop it. This is very likely to create a memory leak.
2018-6-26 12:18:18 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/demo] appears to have started a thread named [org.springframework.scheduling.quartz.SchedulerFactoryBean#0_Worker-4] but has failed to stop it. This is very likely to create a memory leak.
2018-6-26 12:18:18 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/demo] appears to have started a thread named [org.springframework.scheduling.quartz.SchedulerFactoryBean#0_Worker-5] but has failed to stop it. This is very likely to create a memory leak.
2018-6-26 12:18:18 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/demo] appears to have started a thread named [org.springframework.scheduling.quartz.SchedulerFactoryBean#0_Worker-6] but has failed to stop it. This is very likely to create a memory leak.
2018-6-26 12:18:18 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/demo] appears to have started a thread named [org.springframework.scheduling.quartz.SchedulerFactoryBean#0_Worker-7] but has failed to stop it. This is very likely to create a memory leak.
2018-6-26 12:18:18 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/demo] appears to have started a thread named [org.springframework.scheduling.quartz.SchedulerFactoryBean#0_Worker-8] but has failed to stop it. This is very likely to create a memory leak.
2018-6-26 12:18:18 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/demo] appears to have started a thread named [org.springframework.scheduling.quartz.SchedulerFactoryBean#0_Worker-9] but has failed to stop it. This is very likely to create a memory leak.
2018-6-26 12:18:18 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/demo] appears to have started a thread named [org.springframework.scheduling.quartz.SchedulerFactoryBean#0_Worker-10] but has failed to stop it. This is very likely to create a memory leak.
2018-6-26 12:18:19 org.apache.coyote.http11.Http11AprProtocol start
信息: Starting Coyote HTTP/1.1 on http-20804
2018-6-26 12:18:19 org.apache.coyote.ajp.AjpAprProtocol start
信息: Starting Coyote AJP/1.3 on ajp-20904
2018-6-26 12:18:19 org.apache.catalina.startup.Catalina start
信息: Server startup in 23776 ms
问题描述:
应用程序注册了JDBC驱动,但当程序停止时无法注销这个驱动,tomcat为了防止内存溢出,就给强制注销了
问题根源:
一:真的跟内存有关
1.OutOfMemoryError: Java heap space
2.OutOfMemoryError: PermGen space
3.OutOfMemoryError: unable to create new native thread
这类问题的解决方案是通过设置JAVA_OPTS参数来解决,参考信息如下:
JAVA_OPTS=
-Xms512m
-Xmx512m
-XX:NewSize=256m
-XX:MaxNewSize=256m
-XX:PermSize=128m
-XX:MaxPermSize=128m
-XX:SurvivorRatio=6
……
在上面的例子中:
YOUNG+OLD: 512M
YOUNG: 256M
Perm: 128M
Eden: YOUNG*6/(6+1+1)=192M
Survivor: YOUNG/(6+1+1)=32M
Java堆的总尺寸=YOUNG+OLD+Perm=640M
堆的大小可以使用 java -Xmx***M version 命令来测试。支持的话会出现jdk的版本号,不支持会报错。
其初始空间(即-Xms)是物理内存的1/64,最大空间(-Xmx)是物理内存的1/4。可以利用JVM提供的-Xmn -Xms -Xmx等选项可
二:其他错误所致,看到的仅是一个表象
可查看tomcat的日志文件——localhost.yyyy-MM-dd.log中的信息