Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applica

来源:互联网 发布:什么跑步软件好 编辑:程序博客网 时间:2024/06/05 12:44


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 [com/app/server/bean/Customer.hbm.xml] cannot be opened because it does not exist


异常说找不到这个资源[com/app/server/bean/Customer.hbm.xml]

1,因为在配置文件里并没有使用和配置这个资源,所以是缓存问题,在我把服务器删除重建之后,重启服务器就好了。

2,如果在配置文件里配置了这个资源,请检查一下hibernate映射路径是否正确。

3,如果配置路径也正确,请检查一下jar包,是否有冲突,用rar打开hibernate3.jar,里面已经包含annotations相关包,与老版冲突。

     解决的方法:将lib目录下的:hibernate-annotations.jar和hibernate-commons-annotations.jar删除后重新部署即可。


0 0
原创粉丝点击