IntelliJ IDEA 2019.3 x64 编写SSM项目的时候,报错

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.executor.ExecutorException: NO constructor found in ypc.ZWZ.model.User matching [java.lang.String]

日常报错 - NO constructor found in matching [java.lang.String]解决方法

日常报错 - NO constructor found in matching [java.lang.String]解决方法

 

这是因为没有在XXX类中找不到构造方法,如果一个类没有写构造方法,系统会自动添加一个无参的构造方法;如果自己写了一个自定义的构造方法,系统则不再自动生成,所以会产生这个错误。


解决方法:

添加无参构造方法

日常报错 - NO constructor found in matching [java.lang.String]解决方法

 

再次编译运行,就没问题了

日常报错 - NO constructor found in matching [java.lang.String]解决方法

 

相关文章:

  • 2021-08-25
  • 2021-10-28
  • 2021-04-30
  • 2022-03-08
  • 2021-10-19
  • 2021-07-14
  • 2021-11-24
  • 2022-01-12
猜你喜欢
  • 2021-12-12
  • 2022-12-23
  • 2021-09-24
  • 2022-12-23
  • 2021-09-02
  • 2021-12-30
相关资源
相似解决方案