问题描述
Description:
Field userClient in com.itheima.order.service.OrderService required a bean of
type 'com.feign.client.UserClient' that could not be found.
The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)
原因分析:
无法注入,UserClient(package com.feign.client
)与标有@EnableFeignClients注解的启动类OrderApplication(package com.order)不在同一个包下。
解决方案:
在@EnableFeignClients注解后添加属性 basePackages=" "指定client位于哪个包下