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