springBoot项目启动问题, that could not be found.

***************************

APPLICATION FAILED TO START

***************************

Description:

Field userCenterApi in com.zxhy.service.api.usc.service.UserCenterService required a bean of type 'com.zxhy.service.api.usc.api.UserCenterApi' that could not be found.

The injection point has the following annotations:

    - @org.springframework.beans.factory.annotation.Autowired(required=true)

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2024-06-12 16:50:33.789 [main] ERROR o.s.b.diagnostics.LoggingFailureAnalysisReporter:40 - 

***************************
APPLICATION FAILED TO START
***************************

Description:

Field userCenterApi in com.zxhy.service.api.usc.service.UserCenterService required a bean of type 'com.zxhy.service.api.usc.api.UserCenterApi' 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.zxhy.service.api.usc.api.UserCenterApi' in your configuration.

这个问题挺无语的

初看是 类注入不了

还以为是Impl类上缺少@Service的注解 

但是查看有相关注解

事实上应该是编译造成的问题

底下两个选项都可以试下,运行发现不报错。

成功!

造成这个问题有可能是

注入问题

扫包问题

引进来的jar包没有被spring管理,即时jar包中有spring注解。
在主启动类上加入@ComponentScan("/")

但建议还是从编译的角度先检查解决

相关推荐

  1. kafka连接失败时springboot项目启动停机问题

    2024-06-14 02:18:02       35 阅读
  2. SpringBoot项目 nohup启动运行日志过大问题

    2024-06-14 02:18:02       16 阅读
  3. SpringBoot项目启动内存泄漏问题排查与解决

    2024-06-14 02:18:02       14 阅读
  4. Docker应用之SpringBoot项目启动(四)

    2024-06-14 02:18:02       31 阅读
  5. SpringBoot项目如何实现热启动

    2024-06-14 02:18:02       13 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-06-14 02:18:02       16 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-06-14 02:18:02       16 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-06-14 02:18:02       15 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-06-14 02:18:02       18 阅读

热门阅读

  1. 1.提交一个bug需要包括什么内容

    2024-06-14 02:18:02       8 阅读
  2. StarkNet架构之L1-L2消息传递机制

    2024-06-14 02:18:02       10 阅读
  3. ubuntu22.04远程控制桌面的工具

    2024-06-14 02:18:02       10 阅读
  4. STM32串口不定长接收空闲中断

    2024-06-14 02:18:02       7 阅读
  5. Aspose将doc,ppt转成pdf

    2024-06-14 02:18:02       9 阅读
  6. 【Linux】事件处理模式

    2024-06-14 02:18:02       5 阅读
  7. PHP表单的多方面应用与实践

    2024-06-14 02:18:02       8 阅读
  8. 记住用户登录状态的方法:从基础到高级

    2024-06-14 02:18:02       8 阅读
  9. React-Native Modal组件中无法按返回键隐藏

    2024-06-14 02:18:02       10 阅读
  10. 【QT】QSettings读取中文乱码

    2024-06-14 02:18:02       8 阅读
  11. Llama2微调

    2024-06-14 02:18:02       6 阅读
  12. Python记忆组合透明度语言模型

    2024-06-14 02:18:02       8 阅读
  13. screenrecord

    2024-06-14 02:18:02       7 阅读