Consider defining a bean of type 'cn.itcast.feign.clients.UserClient' in your configuration.解决方案
- Feign启动出现的问题
- 解决方案
- 方案一:指定Feign应该扫描的包
- 方案二:指定需要加载的Client接口
Feign启动出现的问题
下面展示 启动时候的错误
。
***************************
APPLICATION FAILED TO START
***************************
Description:
Field userClient in cn.itcast.order.service.OrderService required a bean of type 'cn.itcast.feign.clients.UserClient' 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.itcast.feign.clients.UserClient' in your configuration.
Process finished with exit code 1
解决方案
方案一:指定Feign应该扫描的包
@EnableFeignClients(basePackages = "cn.itcast.feign.clients")
方案二:指定需要加载的Client接口
@EnableFeignClients(clients = {UserClient.class})
更多推荐
Consider defining a bean of type ‘cn.itcast.feign.clients.UserClient‘ in your co
发布评论