Invalid bound statement (not found): com.example.demo.dao.mapper.clDao.queryAll

spring-boot配置Mybatis的时候总是出现这样的情况。
Whitelabel Error Page
控制台显示错误:
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.example.demo.dao.mapper.clDao.queryAll
at org.apache.ibatis.binding.MapperMethod S q l C o m m a n d . < i n i t > ( M a p p e r M e t h o d . j a v a : 235 )   [ m y b a t i s − 3.5.6. j a r : 3.5.6 ] a t o r g . a p a c h e . i b a t i s . b i n d i n g . M a p p e r M e t h o d . < i n i t > ( M a p p e r M e t h o d . j a v a : 53 )   [ m y b a t i s − 3.5.6. j a r : 3.5.6 ] a t o r g . a p a c h e . i b a t i s . b i n d i n g . M a p p e r P r o x y . l a m b d a SqlCommand.<init>(MapperMethod.java:235) ~[mybatis-3.5.6.jar:3.5.6] at org.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:53) ~[mybatis-3.5.6.jar:3.5.6] at org.apache.ibatis.binding.MapperProxy.lambda SqlCommand.<init>(MapperMethod.java:235) [mybatis3.5.6.jar:3.5.6]atorg.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:53) [mybatis3.5.6.jar:3.5.6]atorg.apache.ibatis.binding.MapperProxy.lambdacachedInvoker 0 ( M a p p e r P r o x y . j a v a : 115 )   [ m y b a t i s − 3.5.6. j a r : 3.5.6 ] a t j a v a . u t i l . c o n c u r r e n t . C o n c u r r e n t H a s h M a p . c o m p u t e I f A b s e n t ( C o n c u r r e n t H a s h M a p . j a v a : 1660 )   [ n a : 1.8. 0 1 71 ] a t o r g . a p a c h e . i b a t i s . b i n d i n g . M a p p e r P r o x y . c a c h e d I n v o k e r ( M a p p e r P r o x y . j a v a : 102 )   [ m y b a t i s − 3.5.6. j a r : 3.5.6 ] a t o r g . a p a c h e . i b a t i s . b i n d i n g . M a p p e r P r o x y . i n v o k e ( M a p p e r P r o x y . j a v a : 85 )   [ m y b a t i s − 3.5.6. j a r : 3.5.6 ] a t c o m . s u n . p r o x y . 0(MapperProxy.java:115) ~[mybatis-3.5.6.jar:3.5.6] at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660) ~[na:1.8.0_171] at org.apache.ibatis.binding.MapperProxy.cachedInvoker(MapperProxy.java:102) ~[mybatis-3.5.6.jar:3.5.6] at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:85) ~[mybatis-3.5.6.jar:3.5.6] at com.sun.proxy. 0(MapperProxy.java:115) [mybatis3.5.6.jar:3.5.6]atjava.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660) [na:1.8.0171]atorg.apache.ibatis.binding.MapperProxy.cachedInvoker(MapperProxy.java:102) [mybatis3.5.6.jar:3.5.6]atorg.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:85) [mybatis3.5.6.jar:3.5.6]atcom.sun.proxy.Proxy73.queryAll(Unknown Source) ~[na:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_171]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_171]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_171]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_171]
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344) ~[spring-aop-5.3.4.jar:5.3.4]
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198) ~[spring-aop-5.3.4.jar:5.3.4]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.3.4.jar:5.3.4]

解决方法:

在application.properties里加上

mybatis.mapperLocations=classpath:com/example/demo/dao/sqlmap/*.xml

mapperLocations

或者是这一段路径写错了修改一下。之后便可以查询出来。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值