TOMCAT一直加载不到文件,但是相应的webapps里面又有对应的文件存在

来源:互联网 发布:淘宝店铺客户流失分析 编辑:程序博客网 时间:2024/05/01 00:22

之前在做项目的时候,在自己的电脑上写代码,发现总是加载不到文件,例如:


那时候找了很久都没有找到是什么原因,后来发现错误信息里面提示:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'productDao' defined in file [D:\LUKE\tomcat\apache-tomcat-7.0.20-windows-x64\apache-tomcat-7.0.20\webapps\Copy (2) of tianxiaShop\WEB-INF\classes\com\anseon\dao\ProductDao.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class com.anseon.dao.ProductDao

这才注意到,原来加载的是另一个copy份的应用,所以要把webapps文件夹下面的copy份删除

将copy份删除掉就可以成功开启服务器了

阅读全文
0 0