部署ssh项目,tomcat不能正确启动Error listenerStart
在eclipse里运行正常,使用ant将project打包成war文件,部署到tomcat里,启动,报异常:
信息: Deploying web application archive buildframework.war
2010-8-9 14:41:34 org.apache.catalina.core.StandardContext start
严重: Error listenerStart
2010-8-9 14:41:34 org.apache.catalina.core.StandardContext start
严重: Context [/buildframework] startup failed due to previous errors
2010-8-9 14:41:34 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
严重: A web application registered the JBDC 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.
在控制台里只有这么点信息,上网搜索找不到想要的答案,有的是说将Spring的listener换成servlet方式,有的说是jar包的问题,但从中得到了一个重要启示:去tomcat的log中查看详细的异常信息,具体路径是:%tomcat_home%logs目录下的那些文件,
2010-8-9 14:41:33 org.apache.catalina.core.ApplicationContext log
信息: Initializing Spring root WebApplicationContext
2010-8-9 14:41:34 org.apache.catalina.core.StandardContext listenerStart
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.io.FileNotFoundException: class path resource [hibernate.cfg.xml] cannot be resolved to URL because it does not exist
提示很明确,hibernate.cfg.xml没有找到,哈哈,费了半天时间才发现是这个小问题!