SSM之mapper出现 **.NoSuchMethodException

完整报错:

手动写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截图:

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

只有setter/getter和全参数构造

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


猜你喜欢

转载自blog.csdn.net/qq_36922927/article/details/80494631