在classpath后面的*必不可少,缺少型号的话后面的通配符不起作用。
**表示可以表示任意多级目录,如:上述配置可以查到【com/huaxin/framework/system/dao/UserDaoMapper.xml】
*表示多个任意字符
注意:value=“classpath*:com/huaxin/**/*Mapper.xml” ,.xml前面必须有字母.
如果写成 value=“classpath*:com/huaxin/**/*.xml” 会报错。
五月 14, 2021 9:31:49 下午 org.apache.ibatis.logging.commons.JakartaCommonsLoggingImpl warn
警告: Property 'mapperLocations' was specified but matching resources are not found.
org.apache.ibatis.binding.BindingException: Type interface com.jing.dao.UserMapper 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:779)
at org.mybatis.spring.SqlSessionTemplate.getMapper(SqlSessionTemplate.java:312)
at com.jing.dao.UserDaoImpl.getUsers(UserDaoImpl.java:16)
at com.jing.dao.MyTest.test1(MyTest