abel533 / Mybatis-Spring

这是一个集成了Mybatis分页插件和通用Mapper的示例项目
943 stars 610 forks source link

从 service 层调用 Mapper 遇到问题 #3

Closed rankun203 closed 9 years ago

rankun203 commented 9 years ago

Exception:

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.builder.BuilderException: Error invoking SqlProvider method (tk.mybatis.mapper.provider.MapperProvider.dynamicSQL).  Cause: java.lang.InstantiationException: tk.mybatis.mapper.provider.MapperProvider

Caused by: org.apache.ibatis.builder.BuilderException: Error invoking SqlProvider method (tk.mybatis.mapper.provider.MapperProvider.dynamicSQL).  Cause: java.lang.InstantiationException: tk.mybatis.mapper.provider.MapperProvider

Caused by: java.lang.InstantiationException: tk.mybatis.mapper.provider.MapperProvider

Caused by: java.lang.NoSuchMethodException: tk.mybatis.mapper.provider.MapperProvider.<init>()

VTopicWithUserMapper:

public interface VTopicWithUserMapper extends Mapper<VTopicWithUser> {

}

任何的建议都很感谢 :-)

abel533 commented 9 years ago

有两种可能:

一种是没有使用拦截器方式来配置。

还有就是配置中的mappers没有配置Mapper接口。

如果是这样,你可以看文档如何集成。