Spring框架使用 错误:Does the parameter type of the setter match the return type of the getter?

来源:互联网 发布:现在开淘宝店好做吗 编辑:程序博客网 时间:2024/06/04 18:39

2017-08-17 21:18:39,102 WARN [org.springframework.context.support.ClassPathXmlApplicationContext]

- Exception encountered during context initialization

- cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException

:Error creating bean with name 'CustomerBean' defined in class path resource [applicationContext.xml]

: Error setting property values;

nested exception is org.springframework.beans.NotWritablePropertyException

: Invalid property 'lists' of bean class [com.yiibai.common.Customer]:

Bean property 'lists' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?


Spring使用setters和getters来进行依赖注入,这里没有提供getters和setter方法。在类的定义里面提供get set方法就行了。

阅读全文
0 0
原创粉丝点击