org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.lx.shirotest.sys.dao.UserDao.getAllUser报错
查看了网上的其他方法解决方法,都不是我要的结果。发现我的问题是mybaties的配置问题,挺奇葩的,记录一下
有问题的mybaties配置如下:
# mybatis配置
###################################
mybatis.config.location=mybatis/mybatis-config.xml
mybatis.type.aliases.package=com.lx.shirotest.**.model
mybatis.mapper.locations=classpath*:com/lx/shirotest/**/mapping/*Mapper.xml
###################################
改成如下的就不报错了:
# mybatis配置
###################################
mybatis.config.location=mybatis/mybatis-config.xml
mybatis.typeAliasesPackage=com.lx.shirotest.**.model
mybatis.mapperLocations=classpath*:com/lx/shirotest/**/mapping/*Mapper.xml
###################################
还有就是如果mybatis.typeAliasesPackage=com.lx.shirotest.**.model 的路径得是你的项目路径,对应于mapping中的映射对象的别名。别名也是不能随便起的啊,不然还是会报上面的错误。