tomcat启动很慢的原因
启动后tomcat显示的代码如下:
2014-4-3 10:50:15 org.apache.catalina.core.AprLifecycleListener init
信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:/Program Files/Java/jdk1.6.0_21/bin;D:/tomcat/apache-tomcat-7.0.37/apache-tomcat-7.0.37/bin 2014-4-3 10:50:16 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["http-bio-8080"] 2014-4-3 10:50:16 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["ajp-bio-8009"] 2014-4-3 10:50:16 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 1664 ms 2014-4-3 10:50:17 org.apache.catalina.core.StandardService startInternal
信息: Starting service Catalina 2014-4-3 10:50:17 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/7.0.37 2014-4-3 10:50:17 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\tomcat\apache-tomcat-7.0.37\apache-tomcat-7.0.37\webapps\docs 2014-4-3 10:50:17 org.apache.catalina.util.SessionIdGenerator createSecureRandom
信息: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [156] milliseconds. 2014-4-3 10:50:17 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\tomcat\apache-tomcat-7.0.37\apache-tomcat-7.0.37\webapps\Example1_1 2014-4-3 10:50:18 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\tomcat\apache-tomcat-7.0.37\apache-tomcat-7.0.37\webapps\examples 2014-4-3 10:50:18 org.apache.catalina.core.ApplicationContext log
信息: ContextListener: contextInitialized() 2014-4-3 10:50:18 org.apache.catalina.core.ApplicationContext log
信息: SessionListener: contextInitialized() 2014-4-3 10:50:18 org.apache.catalina.core.ApplicationContext log
信息: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCache', 'org.apache.jasper.compiler.TldLocationsCache@1cebc9f') 2014-4-3 10:50:18 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\tomcat\apache-tomcat-7.0.37\apache-tomcat-7.0.37\webapps\host-manager 2014-4-3 10:50:18 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\tomcat\apache-tomcat-7.0.37\apache-tomcat-7.0.37\webapps\manager 2014-4-3 10:50:19 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\tomcat\apache-tomcat-7.0.37\apache-tomcat-7.0.37\webapps\my_register_login 2014-4-3 10:50:28 org.apache.catalina.core.ApplicationContext log
信息: No Spring WebApplicationInitializer types detected on classpath 2014-4-3 10:50:28 org.apache.catalina.core.ApplicationContext log
信息: Initializing Spring root WebApplicationContext
log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
启动到这的时候,就等个几分钟才能启动成功,看了一下,应该是我的项目my_register_login出了问题。后来上网查了一下,哎,原来是在我的这个项目中使用连接了数据库的操作,而我却没有开启数据库,直到tomcat连接数据库超时之后才会进行下一步,所以启动比较慢。正确的办法是先打开数据库,然后在启动tomcat,哈哈,一切ok~~~