Controller required a bean of type 'com.netflix.discovery.DiscoveryClient' that could not be found.异常处理

注入代码如下:

@Autowired
private DiscoveryClient discoveryClient;

导入的包如下com.netflix.discovery,这个包是错误的,DiscoveryClient有两个包

应该导入import org.springframework.cloud.client.discovery.DiscoveryClient
posted on   supress_Elon_Musk  阅读(2904)  评论(0编辑  收藏  举报
努力加载评论中...

点击右上角即可分享
微信分享提示