maven多模块启动required a bean of type com.xxx.xxx.service that could not be found.
Description:
Field testService in com.xxx.xxx.api.controller.TestController required a bean of type 'com.xxx.xxx.service.TestService' that could not be found.
Action:
Consider defining a bean of type 'com.xxx.xxx.service.TestService' in your configuration.
1.maven多模块启动类:
@SpringBootApplication
@SpringBootApplication(scanBasePackages = {"com.xxx.xxx.service","com.xxx.xxx.api.controller"})
或
@SpringBootApplication(scanBasePackages = {"com.xxx.xxx.**"})
2.TestService类加注解@Service
另外,暴力方法:
@Autowired
TestService testService;
改为
TestService testService = new TestService();
但是,这样就不归spring管理了
maven多模块启动required a bean of type com.xxx.xxx.service that could not be found.的更多相关文章
- Sping Cloud项目启动报A component required a bean of type 'com.tianyan.bbc.dao.SecurityUserBaseMapper' that could not be found.
项目构建正常,启动和Debug报以下错误: Error starting ApplicationContext. To display the conditions report re-run you ...
- 2. springboot启动报错:Field userMapper in com.service.UserService required a bean of type 'com.dao.UserMapper' that could not be found.
报错信息: 2018-06-25 14:26:17.103 WARN 49752 --- [ restartedMain] ationConfigEmbeddedWebApplicationCon ...
- a commponent required a bean of type XXXXXX that could not be found-2022新项目
一.问题由来 目前刚入职一家新公司不久,公司的新项目采用DDD驱动领域设计来进行开发,架构这一块使用的是阿里巴巴开源的最新框架COLA4.0的架构. 主要是这个框架里面的分层设计.主要分为四层:ada ...
- Field userService in com.wuji.controller.UserController required a bean of type 'com.wuji.service.UserService' that could not be found
Field userService in com.wuji.controller.UserController required a bean of type 'com.wuji.service.Us ...
- Spring Cloud Ribbon负载均衡配置类放在Spring boot主类同级增加Exclude过滤后报Field config in com.cloud.web.controller.RibbonConfiguration required a bean of type 'com.netflix.client.config.IClientConfig' that could not b
环境: Spring Cloud:Finchley.M8 Spring Boot:2.0.0.RELEASE 目录结构: 可以看到代码第13行的注释,我已经在@ComponentScan注解中添加了E ...
- 运行springboot项目报错:Field userMapper in XX required a bean of type 'xx' that could not be found.
运行springboot项目报错: *************************** APPLICATION FAILED TO START ************************** ...
- 解决:Field xxMapper in xx.service.impl.xxServiceImpl required a bean of type 'xx.mapper.xxMapper'
1.启动 SpringBoot项目报错,使用的是Springboot.Spring.Mybatis连接Mysql数据库,启动SpringBoot项目报错,错误如下所示: _____ .__/\ .__ ...
- SpringCloud报错: "Field discoveryClient in com.controller.DcController required a bean of type 'com.netflix.discovery.DiscoveryClient' that could not be found."
SpringCloud报错: "Field discoveryClient in com.controller.DcController required a bean of type 'c ...
- spring eureka required a bean of type 'com.netflix.discovery.DiscoveryClient' that could not be found.
spring在集成第三方过程很容易出现类名相同,且基本作用相同的类.这样给初学者带来一定的困惑. 导致用错类而出现以下问题. required a bean of type 'com.netflix. ...
随机推荐
- 5月31日上课笔记-Mysql简介
一.mysql 配置mysql环境变量 path中添加 D:\Program Files\MySQL\MySQL Server 5.7\bin cmd命令: 登录:mysql -uroot -p 退出 ...
- ubuntu 16.04安装Chrome离线crx插件包
/opt/google/chrome/google-chrome --enable-easy-off-store-extension-install 打开浏览器后,输入chrome://extensi ...
- Java前期(静态)绑定和后期(动态)绑定
Java前期(静态)绑定和后期(动态)绑定 程序绑定的概念:绑定指的是一个方法的调用与方法所在的类(方法主体)关联起来.对java来说,绑定分为静态绑定和动态绑定:或者叫做前期绑定和后期绑定. 静态绑 ...
- ggplot map
ggplot {ggplot2} R Documentation Create a new ggplot Description ggplot() initializes a ggplot objec ...
- 使用Fiddler对IPhone手机的应用数据进行抓包分析
原文出自: http://www.cr173.com/html/20064_1.html Fiddler能捕获ISO设备发出的请求,比如IPhone, IPad, MacBook. 等等苹果的设备. ...
- python学习-day 1
Python开发IDE(工具)Pycharm.eclipse1.循环while 条件 #循环体 #条件为真则执行 #条件为假则执行break用于退出所有循环continue用于退出当前循环 2.Pyc ...
- CImage 往Picture Control贴图 图像显示不正常
在使用CImage 往vc控件 picture Control 上贴图的时候图像显示不太正常如图: 已知原始图片的宽高为640*640 而我上面picture Control 控件宽高小于原始图像 ...
- MVC-READ2
框架设计模式 契约式设计.元编程.元数据驱动设计.管道模型.远程代理模式.提供程序模型:
- HTTP协议入门基础
HTTP--Hyper Text Transfer Protocol,超文本传输协议,是一种建立在TCP上的无状态连接. 整个基本的工作流程是 :客户端发送一个HTTP请求,说明客户端想要访问的资源和 ...
- Prism之初识
首先,简单地介绍说一下单一应用程序与复合应用程序. 一.单一应用程序 看看上面这张图片,假如我们当前的需求是实现主界面如图所示.如果将其构建成具有用户控件的传统 WPF 应用程序,首先应构建一个顶层窗 ...