解决org.apache.ibatis.binding.BindingException: Type interface xxx is not known to the MapperRegistry

Exception in thread “main” org.apache.ibatis.binding.BindingException: Type interface com.kk.mapper.EmployeeMapper 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:717)
atorg.apache.ibatis.session.defaults.DefaultSqlSession.getMapper(DefaultSqlSession.java:292)
at com.kk.test.DynamicSqlTest.main(DynamicSqlTest.java:20)

出现这个错误的原因是mapper映射文件的namespace和接口类名不一致!所以注意namespace和接口名要一致!

你可能感兴趣的:(JavaEE)