控制台报错信息:
2021-01-24 16:44:10.239 ERROR 25000 --- [nio-8091-exec-3] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is feign.FeignException$NotFound: status 404 reading MemberService#findByMemID(Integer)] with root cause
一、错误原因:
首先我们看见是404,那么肯定是找不到资源路径~!! 大家一定要擦亮眼睛看看自己的资源路径是否写对。 我列我找寻了许久的问题答案(包括其他博文总结的错误)
404的错误可以跳转这篇文章,写得很仔细,实在找不到了,可以私聊博主错误。博主有空会帮你一起解决,或者加群~~
https://blog.csdn.net/qq_40262372/article/details/112754147
1.Controller层用的是:@Controller注解必须要用@ResponseBody(直接返回数据,返回路径除外)
2.Controller层用的是:@RestController 是不用加@ResponseBody
3.Controller层用的是public方法:调用private是不可以,要改为pubilc
4.Service层和Controller层都需要添加@Autowired
5.注意远程调用的时候,服务器提供路径上的Controller层上面可能还有一层!!
我找了一下午的错误!!! 大家对于这个404 一定要多检查自己的路径!!!!!
二、各种类型的算法高频面试题汇总:
https://blog.csdn.net/qq_40262372/article/details/112556249
三、群里已有字节、滴滴大佬,可帮忙内推!也欢迎其他大厂的工作人士进群!帮忙内推~
QQ群:725936761