当前位置:网站首页>本地调用feign接口报404
本地调用feign接口报404
2022-04-23 19:46:00 【qq_43432057】
首先保证本地的两个服务都注册在同一个注册中心上,然后在调用时报了以下错误:
调用feign失败:status 404 reading XxFeign#Xx(XxDataVO)
原因是被调用服务的配置文件中配置的url与feign接口调用时配置的url不相符;servlet: context-path:后边的url应该作为整个url的一部分,而feign接口注解写的路径不完整;
# 被调用服务的配置文件
servlet:
context-path: /data
// 调用服务的feign接口
@PostMapping("/push")
ServiceResult pushData(@RequestBody ReqPushDataVO reqPushDataVO);
解决方案:
1.注释掉servlet: context-path配置;
2.feign接口注解为全路径 @PostMapping("/data/push");
二者任选其一。
版权声明
本文为[qq_43432057]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qq_43432057/article/details/124266420
边栏推荐
- 命令-sudo
- @Mapperscan and @ mapper
- 【webrtc】Add x264 encoder for CEF/Chromium
- Efficient serial port cyclic buffer receiving processing idea and code 2
- 【webrtc】Add x264 encoder for CEF/Chromium
- Electron入门教程4 —— 切换应用的主题
- uIP1.0 主动发送的问题理解
- Decompile and get the source code of any wechat applet - just read this (latest)
- 考试系统进入试卷优化思路
- Virtual machine performance monitoring and fault handling tools
猜你喜欢

Prefer composition to inheritance
![[webrtc] add x264 encoder for CEF / Chromium](/img/3f/9bf73d6d2aec14ba94dfc6734eb6ac.png)
[webrtc] add x264 encoder for CEF / Chromium

MySQL syntax collation (4)

Zero cost, zero foundation, build profitable film and television applet

山东大学软件学院项目实训-创新实训-网络安全靶场实验平台(六)

2021-2022-2 ACM training team weekly Programming Competition (8) problem solution

Comment créer un pass BEP - 20 sur la chaîne BNB

Kubernetes入门到精通-裸机LoadBalence 80 443 端口暴露注意事项

Esp8266 - beginner level Chapter 1

Project training of Software College of Shandong University - Innovation Training - network security shooting range experimental platform (V)
随机推荐
kibana 报错 server is not ready yet 可能的原因
Electron入门教程3 ——进程通信
Software College of Shandong University Project Training - Innovation Training - network security shooting range experimental platform (8)
Go three ways to copy files
MySQL数据库 - 单表查询(一)
SRS 的部署
goroutine
【h264】libvlc 老版本的 hevc h264 解析,帧率设定
【数值预测案例】(3) LSTM 时间序列电量预测,附Tensorflow完整代码
Command - sudo
渤海期货这家公司怎么样。期货开户办理安全?
Pdf reference learning notes
Application of DCT transform
Speex Wiener filter and rewriting of hypergeometric distribution
The difference between underline and dot of golang import package
Electron入门教程4 —— 切换应用的主题
MFC获取本机IP(网络通讯时用得多)
Unity general steps for creating a hyper realistic 3D scene
IIS data conversion problem: 16bit to 24bit
Possible root causes include a too low setting for -Xss and illegal cyclic inheritance dependencies