Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Type interface is not known to the MapperRegistry" exception using mybatis

Tags:

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?

like image 313
ripper234 Avatar asked Nov 24 '10 05:11

ripper234


1 Answers

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

like image 191
dolbysurnd Avatar answered Sep 18 '22 18:09

dolbysurnd