完整报错:

手动写mapper使用报错:

07-Apr-201820:03:18.026 严重 [http-apr-8083-exec-10]org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() forservlet [taotao-search] in context with path [] threw exception [Requestprocessing failed; nested exception isorg.mybatis.spring.MyBatisSystemException: nested exception isorg.apache.ibatis.reflection.ReflectionException: Error instantiating classcom.taotao.search.model.ItemSearchResult with invalid types () or values ().Cause: java.lang.NoSuchMethodException:com.taotao.search.model.ItemSearchResult.<init>()] with root cause

 java.lang.NoSuchMethodException:com.taotao.search.model.ItemSearchResult.<init>()

atjava.lang.Class.getConstructor0(Class.java:3082)

com.taotao.search.model.ItemSearchResult截图:

SSM之mapper出现 **.NoSuchMethodException

这个bean是用来封装查询结果的,使用在了mapper的配置文件中的resultmap

只有setter/getter和全参数构造

添加上一个无参数构造,问题解决,粗心了


相关文章:

  • 2021-04-07
  • 2021-06-18
  • 2021-10-17
  • 2022-12-23
  • 2022-02-08
  • 2021-04-20
  • 2022-12-23
猜你喜欢
  • 2021-10-27
  • 2022-12-23
  • 2022-02-24
  • 2022-01-04
  • 2021-08-09
  • 2022-01-15
  • 2022-12-23
相关资源
相似解决方案