spring项目启动报错“is not writable or has an invalid setter method”

原因:是idea无法识别@Getter@Setter注释或者getter或者setter方法命名不规范

解决办法:

方法一:打开idea的注释处理器(compiler/Annotation Processors/Enable annotation processing),是程序在编译过程中自动生成所需要的代码;然后clean、compile下maven,重启项目就好了;

方法二:安装插件Lombok,它通过注解的方式生成一些默认的方法(如getter、setter)

posted @ 2024-08-13 11:27  青牛梦旅行  阅读(117)  评论(0)    收藏  举报