Field discoveryClient in com.demo.eureka_client.controller.DcController required a bean of type 'com
来源:互联网 发布:linux man help 编辑:程序博客网 时间:2024/06/15 13:38
原帖链接:http://www.spring4all.com/article/291点击打开链接
问题描述:
按照原帖的教程,在编写eureka-client代码后,启动eureka-client发现启动失败
并提示:
Description:
Field discoveryClient in com.demo.eureka_client.controller.DcController required a bean of type'com.netflix.discovery.DiscoveryClient' that could not be found.
Action:
Consider defining a bean of type 'com.netflix.discovery.DiscoveryClient'in your configuration.
仔细检查了代码,在启动类上加上了@EnableDiscoveryClient仍然还有这个错误。
问题原因:DiscoveryClient导错了jar包。
我导入了com.netflix.discovery.DiscoveryClient;正确的应该是 importorg.springframework.cloud.client.discovery.DiscoveryClient;
解决方案:
导入正确的jar包即可
import org.springframework.cloud.client.discovery.DiscoveryClient
阅读全文
0 0
- Field discoveryClient in com.demo.eureka_client.controller.DcController required a bean of type 'com
- Field userMapper in com.jm.controller.LoginController required a bean of type 'dao.UserMapper' that
- mybatis Field xxxMapper in xxxx required a bean of type 'XXXMapper' that could not be found.
- Field XXX in XXXX required a bean of type XXXX that could not be found.
- Field XX required a bean of type 使用@componentscan 解决
- spring-boot 多数据源配置时出现Field xx in xxx required a bean of type
- Cannot find any information on property 'User' in a bean of type 'com.entity.user'
- Consider defining a bean of type 'com.taikang.service.ChongyGameInfoService' in your configuration.
- Consider defining a bean of type 'com.xxx.service.impl.xxxImpl' in your configuration
- springboot 报错Field XXX required a bean of type XXX that could not be found.
- com.netflix.discovery.DiscoveryClient
- No qualifying bean of type 'com.yubai.bean.BeanWayService' available
- No qualifying bean of type 'com.zjw.service.SysService'错误
- 错误:No qualifying bean of type 'com.mongodb.MongoClient'
- No qualifying bean of type 'com.yubai.el.ELConfig' available
- Null value was assigned to a property of primitive type setter of com.database.bean.Bookinfo.price
- Bean named '*' must be of type [*], but was actually of type [com.sun.proxy.$Proxy34]
- BeanNotOfRequiredTypeException: Bean named "" must be of type [] but was actually of type [com.sun.p
- 虚拟机开发ios环境复制问题
- Webservice实践(八)如何通过WSDL获取java代码
- udev与devtmpfs
- 给定一个单链表,从链表返回一个随机节点的值。 每个节点必须具有相同的选择概率。 跟进: 如果这个链表非常大,而且它的长度不为人知呢? 你能解决这个问题,而不使用额外的空间?
- pytorch入门(二)——自动求导函数
- Field discoveryClient in com.demo.eureka_client.controller.DcController required a bean of type 'com
- oracle-编码
- Eclipse-设置格式化代码时不格式化注释
- Spring boot之hello world故障
- zoj 3664
- c++ make_heap, pop_heap, push_heap, sort_heap详解
- 数据结构实验之图论七:驴友计划
- 酒店管理系统数据库设计说明书
- 换钱的最少货币数