当前位置:网站首页>Startup error: Caused by: org.apache.ibatis.binding.BindingException summary solution
Startup error: Caused by: org.apache.ibatis.binding.BindingException summary solution
2022-08-09 16:03:00 【Students from three provinces】
报错
Springboot启动时从nacos拉取配置.启动报错:
Caused by: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): xxx
at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:227)
at org.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:49)
at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:65)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:58)
at com.sun.proxy.$Proxy143.selectConfigList(Unknown Source)
at com.mmoa.system.service.impl.SysConfigServiceImpl.init(SysConfigServiceImpl.java:37)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:389)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:333)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:157)
... 32 common frames omitted
报错分析
Usually there is an errorCaused by: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found),There are following reasons
1.mapper.xmlScan register
# mybatis配置
mybatis:
# 搜索指定包别名
typeAliasesPackage: com.xx.xx
# 配置mapper的扫描,找到所有的mapper.xml映射文件
mapperLocations: classpath:mapper/**/*.xml
2.mapper接口与mapper.xml不在同一个包(package)The inconsistent or file name
3.mapper.xml的命名空间(namespace)与mapperThe package name of the interface does not agree
4. 接口的方法名,与xml中的sql标签的id不一致
5.接口中的返回值与xml方法配置esultMap或resultType不一致
通过,Screening for several possible situation,All are found the problem,由于是通过nacosPull configuration can be configured not pull to.
Take a closer look at startup information.
15:43:15.030 [main] WARN c.a.c.n.c.NacosPropertySourceBuilder - [loadNacosData,87] - Ignore the empty nacos configuration and get it based on dataId[application-master.yml] & group[DEFAULT_GROUP]
15:43:15.037 [main] WARN c.a.c.n.c.NacosPropertySourceBuilder - [loadNacosData,87] - Ignore the empty nacos configuration and get it based on dataId[test] & group[DEFAULT_GROUP]
15:43:15.043 [main] WARN c.a.c.n.c.NacosPropertySourceBuilder - [loadNacosData,87] - Ignore the empty nacos configuration and get it based on dataId[test.yml] & group[DEFAULT_GROUP]
15:43:15.047 [main] WARN c.a.c.n.c.NacosPropertySourceBuilder - [loadNacosData,87] - Ignore the empty nacos configuration and get it based on dataId[test-master.yml] & group[DEFAULT_GROUP]
15:43:15.052 [main] INFO c.m.s.MmoaSystemApplication - [logStartupProfileInfo,674] - The following profiles are active: master
发现nacosTraining in rotation three configuration, did not get to,猜测正确
注:
拉取Nacos的配置文件时会轮训三个dataID:
格式一:name
文件名:xxx_config;
格式二:name.yaml
文件名+yaml后缀;格式三:name-master.yaml
文件名+profile + 后缀.中间用“-”分割.
解决
环境配置错误,Modify environment restart service success.
# Spring
spring:
application:
# 应用名称
name: test
profiles:
# 环境配置
active: dev
小结
If not change the code,启动报错,Check the configuration environment is correct or try to clear the cache, etc.

我与春风皆过客,你携秋水揽星河.
边栏推荐
- .NET现代应用的产品设计 - DDD实践
- 【Database】Sqlserver如何定时备份数据库和定时清除
- Swift中的Error处理
- 物联网技术概论:1~7章汇总(西安交通大学)
- Shell -- -- -- -- -- - common gadgets, sort and uniq, tr, the cut
- Zero Time Technology | Nomad cross-chain bridge theft of 180 million US dollars incident analysis
- 相似图像的检测方法
- OpenCV - 图像模板匹配 matchTemplate
- 测试工程师,看不上年薪20w,原因居然是...
- MySQL数据库被攻击,被删库勒索,逼迫我使出洪荒之力进行恢复数据
猜你喜欢
随机推荐
Shell编程之循环语句
太厉害了!华为大牛终于把MySQL讲的明明白白(基础+优化+架构)
升级适配AGP 7.0
【DevOps】jekinsBuild step ‘Execute shell‘ marked build as failure
Redis 面试题
常用sql记录
C语言程序设计笔记(浙大翁恺版) 第六周:数据类型
985测试工程师被吊打,学历和经验到底谁更重要?
Grad CAM 模型可视化
DMPE-PEG-Mal Maleimide-PEG-DMPE 二肉豆蔻酰磷脂酰乙醇胺-聚乙二醇-马来酰亚胺
看完腾讯大佬90天整理的“Redis深度笔记”,我直接当场膜拜
C语言程序设计笔记(浙大翁恺版) 第四周:循环
基于FPGA的FIR滤波器的实现(3)—采用Filter Design & Analysis设计
道路形态(道路要素)
C语言程序设计笔记(浙大翁恺版) 第八周:数组
shell------常用小工具,sort,uniq,tr,cut
实践数据湖iceberg 第三十九课 清理快照前后数据文件变化分析
【基础版】整数加减乘除计算器
ORDER BY clause is invalid in views, inline functions, derived tables, subqueries, and common table expressions unless TOP, OFFSET, or FOR XML is also specified
实践数据湖iceberg 第三十八课 spark sql, Procedures语法进行数据治理(小文件合并,清理快照)








