严重: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in file [E:\Develop\apache-tomcat-6.2\webapps\Paging\WEB-INF\classes\applicationContext-common.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.orm.hibernate3.LocalSessionFactoryBean]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/dom4j/DocumentException
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.orm.hibernate3.LocalSessionFactoryBean]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/dom4j/DocumentException
Caused by: java.lang.NoClassDefFoundError: org/dom4j/DocumentException
解决方法:将dom4j-1.6.1.jar拷贝到lib目录下重新编译。
本文解决了在Spring框架中使用Hibernate时遇到的会话工厂(sessionFactory)创建失败的问题,错误提示涉及到dom4j库缺失导致的异常。通过添加正确的dom4j依赖到项目库中,成功解决了此问题。
2218

被折叠的 条评论
为什么被折叠?



