Consider defining a bean of type 'xxx' in your configuration 异常
2018-11-30 17:04
1056 查看
SpringBoot 和 SpringCloud 微服务开发
今天遇到一个细节问题:
发生在两个服务之间!服务A使用服务B的一个类
首先服务A中出现标题异常 xxx 为 com.ntl.base.ReidsService
接下来是服务B的类
然后是服务A的启动项
有可能大神已经看出问题来了
这个异常主要原因开始没有扫描到类,类上的注解和配置都是没有问题的
出现的主要原因是: 服务B的类在包 com.ntl.base 下 服务A的启动类在保 com.ntl.api 下 @SpringBootApplication 值会扫描这个包和这个包下面的所有类 两个包在同一级是扫描不到的
解决方法: 移动启动类到 con.ntl 包下
相关文章推荐
- 关于spring boot自动注入出现Consider defining a bean of type 'xxx' in your configuration问题解决方案
- 关于spring boot自动注入出现Consider defining a bean of type 'xxx' in your configuration问题解决方案
- 关于spring boot自动注入出现Consider defining a bean of type 'xxx' in your configuration问题解决方案 标签: spring 201
- Consider defining a bean of type 'com.xxx.service.impl.xxxImpl' in your configuration
- 处理异常:Consider defining a bean of type 'xxx' in your config
- 关于spring boot自动注入Consider defining a bean of type 'X' in your configuration
- Consider defining a bean of type 'com.taikang.service.ChongyGameInfoService' in your configuration.
- Spring Boot:Consider defining a bean of type '*.*.*' in your configuration
- Consider defining a bean of type ‘tk.mybatis.mapper.common.Mapper’ in your configuration.
- Maven多模块开发Action:Consider defining a bean of type '*.*.*' in your configuration解决
- Consider defining a bean of type 'app.mapper.UserMapper' in your configuration.
- 错误:Consider defining a bean of type '*.UserService' in your configuration
- Consider definig a bean of type "" in your configuration
- Consider defining a bean of type com.hd.cloud.dao.biz.ShopFansDao in your config
- 异常处理_Cannot find any information on property 'XXX' in a bean of type 'XXX'
- 启动异常 Field XXX in XXXX required a bean of type XXXX that could not be found.
- Consider defining a bean named 'entityManagerFactory' in your configuration.
- springboot+shiro报错:Consider defining a bean named 'authenticator' in your configuration.
- 关于spring boot自动注入出现Consider defining a bean of type 'xxx' in your configuration问题解决方案
- Field XXX in XXXX required a bean of type XXXX that could not be found.