Spring出现错误:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userServiceIMP' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'userDAO' of bean class [njcc.soft.service.UserServiceIMP]: 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?
原因:
Spring 配置bean时属性名错误,应该为程序中定义的同类型的变量名。
在配置dao和daoaction时,daoaction中局部变量名和daoaction中property的name一致,也必须和引用的bean的id一致。