当前位置:网站首页>本地调用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
边栏推荐
- Mysql database - single table query (III)
- How about Bohai futures. Is it safe to open futures accounts?
- Pdf reference learning notes
- 基于pytorch搭建GoogleNet神经网络用于花类识别
- Redis core technology and practice 1 - start with building a simple key value database simplekv
- Grafana 分享带可变参数的链接
- 对普通bean进行Autowired字段注入
- Go recursively loops through folders
- 山东大学软件学院项目实训-创新实训-网络安全靶场实验平台(七)
- Is meituan, a profit-making company with zero foundation, hungry? Coupon CPS applet (with source code)
猜你喜欢
Project training of Software College of Shandong University - Innovation Training - network security shooting range experimental platform (V)
命令-sudo
山东大学软件学院项目实训-创新实训-网络安全靶场实验平台(七)
RuntimeError: Providing a bool or integral fill value without setting the optional `dtype` or `out`
Using oes texture + glsurfaceview + JNI to realize player picture processing based on OpenGL es
No, some people can't do the National Day avatar applet (you can open the traffic master and earn pocket money)
如何在BNB链上创建BEP-20通证
[报告] Microsoft :Application of deep learning methods in speech enhancement
Understanding various team patterns in scrum patterns
程序设计语言基础(2)
随机推荐
Esp8266 - beginner level Chapter 1
DevOps集成-Jenkins 服务的环境变量和构建工具 Tools
Efficient serial port cyclic buffer receiving processing idea and code 2
点云数据集常用处理
Comment créer un pass BEP - 20 sur la chaîne BNB
Class loading process of JVM
@MapperScan与@Mapper
【webrtc】Add x264 encoder for CEF/Chromium
SRS 的部署
The difference between underline and dot of golang import package
Mysql database - single table query (I)
Zero base to build profit taking away CPS platform official account
Software College of Shandong University Project Training - Innovation Training - network security shooting range experimental platform (8)
MySQL syntax collation (3)
LeetCode异或运算
[webrtc] add x264 encoder for CEF / Chromium
NiO related Basics
山东大学软件学院项目实训-创新实训-网络安全靶场实验平台(六)
TI DSP的 FFT与IFFT库函数的使用测试
【h264】libvlc 老版本的 hevc h264 解析,帧率设定