“Type interface is not known to the MapperRegistry

2020-05-23 03:32发布

I'm setting up mybatis using annotations, and getting this helpful exception

org.apache.ibatis.binding.BindingException: Type interface org.foo.Bar is not known to the MapperRegistry

Googling it doesn't find anything, nor the user guide. What am I missing?

7条回答
对你真心纯属浪费
2楼-- · 2020-05-23 04:00

just for anyone who ended up here because they're new to mybatis http://www.mybatis.org/core/configuration.html
http://www.mybatis.org/mybatis-3/configuration.html

in the config file mappers section

<mappers>
<mapper class="my.package.com.MyClass"/>
</mappers>

this will have you up and running with a config.xml and annotated interfaces

查看更多
登录 后发表回答