ReflectionException: Error instantiating interface

HTTP Status 500 - Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: Error instantiating interface com.temp.mapper.TempMapper with invalid types () or values (). Cause: java.lang.NoSuchMethodException: com.temp.mapper.TempMapper.<init>()

以上,在instantiate接口TempMapper的时候出错,原因是出现非法的类或值,排错直接找TempMapper这个接口就好,要么是这个接口本身有问题,这个网上给出的原因有三种:

1) model中的get/set方法与成员变量不一。
2) 构造函数被重载过,但是没有空的构造函数。
3) 最好不要使用简单类型,如int, long等,改用对象模式Integer, Long等

要么是TempMapper在TempMapper.xml中的配置不妥,要检查parameterType,resultType指定的类是否正确等

猜你喜欢

转载自blog.csdn.net/ivorybeach/article/details/80433455