Exception in thread "main" org.apache.ibatis.binding.BindingException: Type interface com.test.bean.groupMapper is not known to the MapperRegistry.


Exception in thread "main" org.apache.ibatis.binding.BindingException: Type interface com.test.bean.groupMapper is not known to the MapperRegistry.
    at org.apache.ibatis.binding.MapperRegistry.getMapper(MapperRegistry.java:47)
    at org.apache.ibatis.session.Configuration.getMapper(Configuration.java:745)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.getMapper(DefaultSqlSession.java:292)

解决办法,逆工程没有添加对应的映射包路径,加好就可以了,mybatis.xml中添加

  <!-- 映射文件方式1,一个一个的配置
        <mapper resource="cn/thinknovo/pojo/UserMapper.xml"/>-->
        <!-- 映射文件方式2,自动扫描包内的Mapper接口与配置文件 -->
        <package name="com/test/pojo"/>
        <package name="com/test/bean"/>

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM