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"/>