根据日志分析异常:There is already 'XXX' bean method
问题代码:
@Slf4j
@Api(value = "paymentOrderController", description = "PaymentOrderController api")
@RestController
@RequestMapping(value = "/auth/hospital/payment/order")
public class PaymentOrderController { @RequestMapping(method = RequestMethod.GET, name = "/updatePaymentOrder")
int updatePaymentOrder(@RequestParam("paymentOrderId") String paymentOrderId, @RequestParam("orderStatus") String orderStatus) {
return 0;
} @RequestMapping(method = RequestMethod.GET, name = "/selectList")
List<TPaymentOrder> selectList(@RequestParam("businessId") String businessId, @RequestParam("businessType") String businessType) {
return null;
}
异常:

从以上日志中可以看出paymentOrderController中存在同样的方法,且指明 selectList 、updatePaymentOrder存在多个。
但是全局搜索关键字后,确定没有多个该方法。
可以配置日志打印出spring boot加载的所有Bean及其Method,追踪打印日志,以updatePaymentOrder为关键词搜索,可看到:

updatePaymentOrder的Mapped为:Mapped "{[/auth/hospital/payment/order],methods=[GET]}"......
明显有问题,正常的应该是:Mapped "{[/auth/hospital/payment/order/updatePaymentOrder],methods=[GET]}"
由此可知, selectList 、updatePaymentOrder两个方法的请求路径写的有问题,对比其他正常的请求,可知:
在@RequestMapping中,路径的键应该是value或者path,而不能是name,否则会默认为类指定的path或者/
@RequestMapping(method = RequestMethod.GET, value = "/updatePaymentOrder")
注:Spring Boot项目启动遇到问题抛异常时,可直接在SpringApplication的run的异常捕获里面打断点,可以直观的看到问题所在。因为有些异常日志不会打印。

根据日志分析异常:There is already 'XXX' bean method的更多相关文章
- 网站开发进阶(八)tomcat异常日志分析及处理
tomcat异常日志分析及处理 日志信息如下: 2015-10-29 18:39:49 org.apache.coyote.http11.Http11Protocol pause 信息: Pausin ...
- iOS崩溃日志分析-b
1名词解释 1.1. UUID 一个字符串,在iOS上每个可执行文件或库文件都包含至少一个UUID,目的是为了唯一识别这个文件. 1.2. dwarfdump 苹果提供的命令行工具,其中一些功能就是查 ...
- Linux日志分析ELK环境搭建
场景:ELK作为一个日志收集和检索系统,感觉功能还是相当的强大的. ELK是啥, 其实是是三个组件的缩写, 分别是elasticsearch, logstash, kibana. ELK平台可以用于实 ...
- 小项目一---Python日志分析
日志分析 概述 分析的前提 半结构化数据 文本分析 提取数据(信息提取) 一.空格分隔 with open('xxx.log')as f: for line in f: for field in ...
- ELK日志分析 学习笔记
(贴一篇之前工作期间整理的elk学习笔记) ELK官网 https://www.elastic.co ELK日志分析系统 学习笔记 概念:ELK = elasticsearch + logstas ...
- 安卓app测试之Monkey日志分析
转:原文:https://blog.csdn.net/a136332462/article/details/76066909 一.一般测试结果分析-搜索关键字: 1.无响应问题可以在日志中搜索 “A ...
- centos7搭建EFK日志分析系统
前言 EFK可能都不熟悉,实际上EFK是大名鼎鼎的日志系统ELK的一个变种 在没有分布式日志的时候,每次出问题了需要查询日志的时候,需要登录到Linux服务器,使用命令cat -n xxxx|grep ...
- 干货:ANR日志分析全面解析
一.概述 解决ANR一直是Android 开发者需要掌握的重要技巧,一般从三个方面着手. 开发阶段:通过工具检查各个方法的耗时,卡顿情况,发现一处修改一处. 线上阶段:这个阶段主要依靠监控工具发现AN ...
- ELK+Kafka集群日志分析系统
ELK+Kafka集群分析系统部署 因为是自己本地写好的word文档复制进来的.格式有些出入还望体谅.如有错误请回复.谢谢! 一. 系统介绍 2 二. 版本说明 3 三. 服务部署 3 1) JDK部 ...
随机推荐
- hibernate环境搭建及操作
一.导入jar包.1.hibernate的jar包2.jdbc的jar包 二.配置Hibernate.建立hibernate.cfg.xml mysql配置如下: <!DOCTYPE hiber ...
- Maximum Average Subarray
Given an array with positive and negative numbers, find the maximum average subarray which length sh ...
- SVG的用法
三种添加方式 <iframe src="图的地址" frameborder="0"></iframe> <object width ...
- 1.5 pycharm使用
1.5 pycharm使用 前言 在写脚本之前,先要找个顺手的写脚本工具.python是一门解释性编程语言,所以一般把写python的工具叫解释器.写python脚本的工具很多,小编这里就不一一 ...
- 姿势估计实验-Realtime_Multi-Person_Pose_Estimation-CMU
前言: 论文及源代码网址: https://github.com/ZheC/Realtime_Multi-Person_Pose_Estimation 地址2: https://github.com/ ...
- Okhttp、Volley和Gson的简单介绍和配合使用
转载自:http://www.apkbus.com/home.php?mod=space&uid=784586&do=blog&id=61255 1.okhttp是一个高效的. ...
- ViewpageMaiActity
<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android=&qu ...
- 4.python字符串格式化
格式化字符串时,Python使用一个字符串作为模板.模板中有格式符,这些格式符为真实值预留位置,并说明真实数值应该呈现的格式.Python用一个tuple将多个值传递给模板,每个值对应一个格式符.py ...
- linux下查询java进程以及杀掉其进程
1.使用命令: ps -ef|grep java 查询到到自己想要kill掉的进程id 2.使用命令: kill -9 id(这里的id为你上一步查找到的id)
- LeetCode - Online Election
In an election, the i-th vote was cast for persons[i] at time times[i]. Now, we would like to implem ...