Invalid bound statement (not found)

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中的映射对象的别名。别名也是不能随便起的啊,不然还是会报上面的错误。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值