Bean property 'xxx' is not writable or has an invalid setter method

寵の児 提交于 2019-12-05 11:27:46

ListTypeController doesn't have a property of the appropriate type to receive the typeService bean, or else the setter for that property is malformed. Note that if you have some proxying going on and your ListTypeController specifies the type as TypeServiceImpl, then it may be because you should be referring to the bean by its interface type, TypeService. A proxy of your typeService would be a TypeService, but not a TypeServiceImpl.

Update: Based on your new code: setTypeServic should be setTypeService, or else your property name is actually typeServic.

In my case i named my propery as: isMyProperty and is in prefix caused an issue. I had to change the name to myProperty.

In my case it was because I had correct setter and getter but each with different type.

My setter took String and parsed it to target enum type and my getter returned directly the enum.

For some reason Spring (v3) got confused.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!