SpringCloud +openfeign startup error

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2023-02-14 21:42:10.851 ERROR 7392 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

Field goodsFeignService in com.waper.auth.controller.UserController required a bean of type 'com.waper.goodsserviceapi.feign.GoodsFeignService' 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 'com.waper.goodsserviceapi.feign.GoodsFeignService' in your configuration.

I saw it online that:

If the @EnableFeignClients annotation exists in only one startup class, there is no need to add basepackage and no error will be reported and the startup will be successful;
But once there are two or more business modules as Feign client, that is, if there are more than two startup classes with @EnableFeignClients annotation, the above error will be reported if basepackage is not added.

Insert image description here

Guess you like

Origin blog.csdn.net/weixin_40796433/article/details/129034139