spring+struts2+mybatis 整合报错
问题描述:1.第一个图是applicationContext.xml的部分截图代码,spring生成的userDao对象引用了sqlSessionFactory的对象;2...
问题描述:1. 第一个图是applicationContext.xml的部分截图代码,spring生成的userDao对象引用了sqlSessionFactory 的对象;2. 第二图是报错信息,说 userDao是无用的bean请问,这是怎么回事啊?
后台错误:
Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'userDao' of bean class [com.yg.testdangdang.service.impl.UserServiceImpl]: Bean property 'userDao' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:1042)
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:902)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:75)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:57)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1424)
... 26 more 展开
后台错误:
Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'userDao' of bean class [com.yg.testdangdang.service.impl.UserServiceImpl]: Bean property 'userDao' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:1042)
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:902)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:75)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:57)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1424)
... 26 more 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询