Failed to convert property value of type [$Proxy13] to required type [com.llm.dao.UserDAOImpl]\;
找不到问题代码了,因为已经解决了。。。大概就是因为自己写的DAO层的文件名是UserDAO而不是UserDao,所以在spring配置文件applicationContext.xml中会对UserDAO进行自动注入,也就是自动形成接口注入,所以此时如果你用UserDaoImpl,他会说匹配错误。这时候只要把所有的UserDAO改成UserDao就行,也就是不要跟自动注入的DAO文件格式相同就行。
<!-- 配置业务层的类 -->
<bean id="loginService" class="com.llm.service.impl.LoginServiceImpl">
<property name="userDao" ref="userDao"/>
</bean>
<!-- 配置DAO的类 -->
<bean id="userDao" class="com.llm.dao.impl.UserDaoImpl">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
Caused by: org.springframework.beans.NotWritablePropertyException: Invalid [com.ywr.shopping.service.impl.UserServiceImpl] of bean class [com.ywr.shopping.service.impl.UserServiceImpl]: Bean property 'userDao' is not writable or has an invalid setter method. Did you mean 'userDAO'?
这个地方是loginService中property 的name写错了,检查一下自己写的LoginServiceImpl文件就行了。