JAVA SSH整合问题 郁闷死我了

来源:百度知道 编辑:UC知道 时间:2024/07/03 02:48:27
tomcat已启动就报错
org.springframework.beans.factory.BeanCreationException: Error creating bean with name '/userdo' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [$Proxy1] to required type [dao.UserDao] for property 'userdao'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [$Proxy1] to required type [dao.UserDao] for property 'userdao': no matching editors or conversion strategy found
Caused by:
org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessException details (1) are:
PropertyAccessException 1:
org.springframework.beans.TypeMismatchException: Failed to convert property value of type [$Pr

org.springframework.beans.factory.BeanCreationException: Error creating bean with name '/userdo' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Error setting property values

你仔细检查一下你的UserAction这个类是怎么注入的
是否set了进去

错误估计就在这里

ssh好久没用了 有什么不懂留言

先给你

指出一点错误吧。。其他的具体情况具体对待:

<bean name="/userdo" class="action.UserAction">
<property name="userdao">
<ref bean="userDao" />
</property>

第一个 : userDao

大写

祝你好运!

action.UserAction 这个类检查检查

<property name="userdao">
<ref bean="userDao" />

这两个DAO类型不一样。。你自己看代码

<bean id="userDao" class="dao.UserDao">
<property name="sessionFactory">
<ref local="sessionFactory" />//应该是<ref bean="sessionFactory"