当我访问:
http://localhost:8001/dept/add?dName=aa的时候

发现问题:
org.apache.ibatis.reflection.ReflectionException: There is no getter for property named ‘dname’ in ‘class com.thunder.springcloud.pojo.Dept’
org.apache.ibatis.reflection.ReflectionException: There is no getter for property named ‘dname‘...
问题翻译过来的意思是:
org.apache.ibatis.reflection。ReflectionException:在class com.thunder.springcloud.pojo.Dept中没有名为dname的属性的getter

解决问题:
根据以往的解决类似bug的经验来看,出现问题的地方就那几个,使用了mybatis框架的xml配置错误,或者使用注解属性配置错误,接口方法的参数,在数据库字段和实体类名字不对应的情况下没有添加注解…
查看com.thunder.springcloud.pojo.Dept是否有dname这个属性?
org.apache.ibatis.reflection.ReflectionException: There is no getter for property named ‘dname‘...
有这个属性,也有get和set方法,实体类没有问题。

那我直接找我的代码出现dname的地方,发现了问题:
org.apache.ibatis.reflection.ReflectionException: There is no getter for property named ‘dname‘...

把dname改成dName重新运行,问题就解决了。

相关文章:

  • 2021-09-02
  • 2022-12-23
  • 2021-11-29
  • 2022-12-23
  • 2021-05-04
  • 2021-09-12
  • 2022-12-23
  • 2021-06-25
猜你喜欢
  • 2021-12-07
  • 2021-08-17
  • 2021-04-07
  • 2021-09-11
  • 2021-07-10
  • 2021-11-20
  • 2022-01-23
相关资源
相似解决方案