ERROR [org.springframework.web.context.ContextLoader] - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'iquestiondaoimpl' defined in ServletContext resource [/WEB-INF/classes/applicationContext.xml]: Error setting property values; nested exception is PropertyAccessExceptionsException (1 errors)
PropertyAccessExceptionsException (1 errors)
org.springframework.beans.TypeMismatchException: Failed to convert property value of type [org.springframework.orm.hibernate3.HibernateTemplate] to required type [org.springframework.orm.hibernate.HibernateTemplate] for property 'hibernateTemplate'
产生这个错误的原因:
实现接口有错误,但看了没有找到错误
经仔细检查,发现
import org.springframework.orm.hibernate.support.HibernateDaoSupport;
错误,
应该是:
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'iquestiondaoimpl' defined in ServletContext resource [/WEB-INF/classes/applicationContext.xml]: Error setting property values; nested exception is PropertyAccessExceptionsException (1 errors)
PropertyAccessExceptionsException (1 errors)
org.springframework.beans.TypeMismatchException: Failed to convert property value of type [org.springframework.orm.hibernate3.HibernateTemplate] to required type [org.springframework.orm.hibernate.HibernateTemplate] for property 'hibernateTemplate'
产生这个错误的原因:
实现接口有错误,但看了没有找到错误
经仔细检查,发现
import org.springframework.orm.hibernate.support.HibernateDaoSupport;
错误,
应该是:
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
Spring Hibernate 集成问题
本文解决了一个关于Spring框架中Hibernate集成的问题,具体表现为在创建名为'iquestiondaoimpl'的bean时出现类型不匹配的异常,导致无法正确设置属性值。通过修正HibernateDaoSupport的导入包路径解决了该问题。
8988

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



