欢迎来到代码驿站!

JAVA代码

当前位置:首页 > 软件编程 > JAVA代码

Java之SpringCloud Eurka注册错误解决方案

时间:2022-01-17 10:49:39|栏目:JAVA代码|点击:

学习SpringCloud时,在Eurka中注册时出现的错误:

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-10-04 11:15:19.703 ERROR 34860 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 
 
***************************
APPLICATION FAILED TO START
***************************
 
Description:
 
Field discoveryClient in cn.itcast.consumer.web.ConsumerController required a bean of type 'com.netflix.discovery.DiscoveryClient' 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.netflix.discovery.DiscoveryClient' in your configuration.
 

错误代码:

import com.netflix.discovery.DiscoveryClient;
 
@Autowired
private DiscoveryClient discoveryClient;

错误原因:导错了jar包

正确代码:

import org.springframework.cloud.client.discovery.DiscoveryClient;
 
 
@Autowired
private DiscoveryClient discoveryClient;

上一篇:Java拦截器Interceptor和过滤器Filte的执行顺序和区别

栏    目:JAVA代码

下一篇:Java实现单向链表反转

本文标题:Java之SpringCloud Eurka注册错误解决方案

本文地址:http://www.codeinn.net/misctech/190502.html

推荐教程

广告投放 | 联系我们 | 版权申明

重要申明:本站所有的文章、图片、评论等,均由网友发表或上传并维护或收集自网络,属个人行为,与本站立场无关。

如果侵犯了您的权利,请与我们联系,我们将在24小时内进行处理、任何非本站因素导致的法律后果,本站均不负任何责任。

联系QQ:914707363 | 邮箱:codeinn#126.com(#换成@)

Copyright © 2020 代码驿站 版权所有