问题描述
- spring4 整合 hibernate时 产生HibernateTemplate报错
-
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'urlMapping' defined in ServletContext resource [/WEB-INF/web-config.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userController' defined in ServletContext resource [/WEB-INF/web-config.xml]: Cannot resolve reference to bean 'userService' while setting bean property 'userService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userService' defined in ServletContext resource [/WEB-INF/service-config.xml]: Cannot resolve reference to bean 'userDao' while setting bean property 'userDao'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDao' defined in ServletContext resource [/WEB-INF/dao-config.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'org.springframework.orm.hibernate4.HibernateTemplate' to required type 'org.springframework.orm.hibernate3.HibernateTemplate' for property 'hibernateTemplate'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [org.springframework.orm.hibernate4.HibernateTemplate] to required type [org.springframework.orm.hibernate3.HibernateTemplate] for property 'hibernateTemplate': no matching editors or conversion strategy found
解决方案
no matching editors or conversion strategy found//没有发现匹配的编辑器或版本策略。
可能是版本不匹配。
你看看你的配置有没有错误,没有错误就大概是这个问题了
解决方案二:
'urlMapping' 这没有在web-config.xml中配置bean
时间: 2024-08-31 17:14:33