首页 > 编程语言 > 详细

解决Caused by: org.springframework.beans.NotWritablePropertyException总结

时间:2017-07-08 12:52:26      阅读:203      评论:0      收藏:0      [点我收藏+]

       提出:今天做springxml的setter注入属性demo出现的属性无法注入的bug.

      错误信息如下:

Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property ‘27‘ of bean class [com.wg.xml_setter.Person]: Bean property ‘27‘

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

        解决思路:

                            (1):一般属性的正确的getter和setter的第二个字母是大写,有时利用快捷键生成时第二个字母是小写,故无法注入.

                                           属性编写规范:忌属性名在合成单词时都使用大写

                            (2):检查xml配置文件,我的错误就是手残写错地方导致的

                                  技术分享

 

                                       这里我把本该写age的填了值

解决Caused by: org.springframework.beans.NotWritablePropertyException总结

原文:http://www.cnblogs.com/w-gao/p/7136334.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!