这个是我遇到的问题,方便以后排查错误,不一定会对你有用。也希望你是和我遇到同样的坑,方便解决这个问题。

首先看一下我的问题

在启动的时候控制台出现这个错误

Description:

Field feignArticleController in cn.luocome.xxx.system.service.impl.SysUserServiceImpl required a bean of type 'cn.luocome.xxx.feign.IFeignArticleController' that could not be found.

The injection point has the following annotations:
    - @org.springframework.beans.factory.annotation.Autowired(required=true)


Action:

Consider defining a bean of type 'cn.luocome.xxx.feign.IFeignArticleController' in your configuration.


Process finished with exit code 0

提示我一直没有进行远程接口的注入,于是我在这个微服务启动器上加了 @EnableDiscoveryClient

这个注解,但是还是出现上述问题。

于是我重新看了一下我的服务路径

这个时候我发现我的问题所在了

我不小心把启动器的目录放深了一层,这就导致我在Nacos的配置一直读取不到Fegin远程接口

我就将启动器重新换了一下路径

和上面保持一致,再重新启动,发现微服务跑起来了

最后修改:2022 年 02 月 14 日
如果觉得我的文章对你有用,请随意赞赏