当前位置:网站首页>本地调用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
边栏推荐
- Zero base to build profit taking away CPS platform official account
- Codeworks round 783 (Div. 2) d problem solution
- Fundamentals of programming language (2)
- RuntimeError: Providing a bool or integral fill value without setting the optional `dtype` or `out`
- LeetCode异或运算
- uIP1. 0 actively sent problem understanding
- Understanding various team patterns in scrum patterns
- Unity创建超写实三维场景的一般步骤
- FFT物理意义: 1024点FFT就是1024个实数,实际进入fft的输入是1024个复数(虚部为0),输出也是1024个复数,有效的数据是前512个复数
- Scrum Patterns之理解各种团队模式
猜你喜欢
【文本分类案例】(4) RNN、LSTM 电影评价倾向分类,附TensorFlow完整代码
Build intelligent garbage classification applet based on Zero
【数值预测案例】(3) LSTM 时间序列电量预测,附Tensorflow完整代码
【webrtc】Add x264 encoder for CEF/Chromium
Prefer composition to inheritance
Shanda Wangan shooting range experimental platform project - personal record (V)
Application of DCT transform
Virtual machine performance monitoring and fault handling tools
山东大学软件学院项目实训-创新实训-网络安全靶场实验平台(五)
精简CUDA教程——CUDA Driver API
随机推荐
Esp8266 - beginner level Chapter 1
Kubernetes入门到精通-KtConnect(全称Kubernetes Toolkit Connect)是一款基于Kubernetes环境用于提高本地测试联调效率的小工具。
Speex Wiener filter and rewriting of hypergeometric distribution
MySQL practical skills
NiO related Basics
Why is the hexadecimal printf output of C language sometimes with 0xff and sometimes not
DevOps集成-Jenkins 服务的环境变量和构建工具 Tools
MySQL syntax collation
深度分析数据恢复原理——那些数据可以恢复那些不可以数据恢复软件
山东大学软件学院项目实训-创新实训-网络安全靶场实验平台(八)
The textarea cursor cannot be controlled by the keyboard due to antd dropdown + modal + textarea
An example of using JNI to directly access surface data
The usage of slice and the difference between slice and array
Compact CUDA tutorial - CUDA driver API
Electron入门教程4 —— 切换应用的主题
MySQL数据库 - 单表查询(二)
The difference between underline and dot of golang import package
MySQL数据库 - 连接查询
Efficient serial port cyclic buffer receiving processing idea and code 2
命令-sudo