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.的更多相关文章

  1. 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. 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 ...

  3. a commponent required a bean of type XXXXXX that could not be found-2022新项目

    一.问题由来 目前刚入职一家新公司不久,公司的新项目采用DDD驱动领域设计来进行开发,架构这一块使用的是阿里巴巴开源的最新框架COLA4.0的架构. 主要是这个框架里面的分层设计.主要分为四层:ada ...

  4. 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 ...

  5. 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 ...

  6. 运行springboot项目报错:Field userMapper in XX required a bean of type 'xx' that could not be found.

    运行springboot项目报错: *************************** APPLICATION FAILED TO START ************************** ...

  7. 解决:Field xxMapper in xx.service.impl.xxServiceImpl required a bean of type 'xx.mapper.xxMapper'

    1.启动 SpringBoot项目报错,使用的是Springboot.Spring.Mybatis连接Mysql数据库,启动SpringBoot项目报错,错误如下所示: _____ .__/\ .__ ...

  8. 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 ...

  9. spring eureka required a bean of type 'com.netflix.discovery.DiscoveryClient' that could not be found.

    spring在集成第三方过程很容易出现类名相同,且基本作用相同的类.这样给初学者带来一定的困惑. 导致用错类而出现以下问题. required a bean of type 'com.netflix. ...

随机推荐

  1. 存在继承关系的Java类对象之间的类型转换(一)

      类似于基本数据类型之间的强制类型转换. 存在继承关系的父类对象和子类对象之间也可以 在一定条件之下相互转换. 这种转换需要遵守以下原则: 1.子类对象可以被视为是其父类的一个对象2.父类对象不能被 ...

  2. C#直接解析Json键值对

    string test_json = "{\"name\":\"tom\",\"nickname\":\"tony\&q ...

  3. tcpdump查看某个端口数据

    tcpdump -i eth0 -nn -A port tcpdump src

  4. 31_java之项目中的数据库操作

    01项目训练目标 * A: 项目训练目标 * a: 项目目标 * 综合运用前面所学习的知识点 * 熟练View层.Service层.Dao层之间的方法相互调用操作. * 熟练dbutils操作数据库表 ...

  5. mybatis 需要注意的点 MyBatis 插入空值时,需要指定JdbcType (201

    转自:https://blog.csdn.net/snakemoving/article/details/76052875 前天遇到一个问题 异常显示如下: 引用 Exception in threa ...

  6. Redhat 7.2 编译安装PostgreSQL 10

    1.环境说明 CentOS7.2 postgresql10.4 2.下载 postgresql的官方地址 https://www.postgresql.org/ftp/source/ 在下载列表中根据 ...

  7. How To Manually Install Oracle Java on Ubuntu

    Introduction Java is a programming technology originally developed by Sun Microsystems and later acq ...

  8. Unix高级编程Note1

    [Unix Notes] 1./etc/passwd 2.extern int errno; 3.限制, limit.h 4.文件原子操作:O_EXCL & O_CREAT 5.stat操作 ...

  9. VS2015解决方案资源管理器空白,不显示内容

    解决方法: 1.先关闭vs: 2.把C:/Users/<users name>/AppData/Local/Microsoft/VisualStudio/14.0/ComponentMod ...

  10. jquery中的trigger()和preventDefault()方法

    trigger()方法用户模拟用户操作,比较常见的一种情况就是输入框自动获得焦点: <!doctype html> <html> <head> <meta c ...