问题说明:
在注入OSSClient报错,找不到bean

报错信息
1:required a bean of type ‘com.aliyun.oss.OSSClient’ that could not be found.
2:如果遇到@org.springframework.beans.factory.annotation.Autowired(required=true)也可以采用如下思路解决

问题到源码之路

使用:

报错如图:

原因说明:

从自动配置入手,查看源码-如图

1查找文件

2查看配置

3发现是接口

得到解决方案

我们不是使用实现类型,要使用接口类型
采用

 @AutowiredOSS ossClient;

完美解决

解决 required a bean of type ‘com.aliyun.oss.OSSClient‘ that could not be found相关推荐

  1. 关于解决required a bean of type ‘XXX’ that could not be found.的问题

    解决required a bean of type 'XXX' that could not be found.的问题 本人java菜鸟一枚,最近在新做的springboot里面关于无法注入Bean的 ...

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

    前些天发现了一个巨牛的人工智能学习网站,通俗易懂,风趣幽默,忍不住分享一下给大家.点击跳转到教程. 1. 启动 springboot 项目报错: Field userMapper in gentle. ...

  3. 解决:A component required a bean of type ‘javax.jms.Queue‘ that could not be found.

    前些天发现了一个巨牛的人工智能学习网站,通俗易懂,风趣幽默,忍不住分享一下给大家.点击跳转到教程. 1. 情景描述:只是想简单写个 ActiveMQ 的小样,启动服务却报错: Error starti ...

  4. Field eFaultPriorityService in com.ect.emes.admin.restapi.AlarmRestApi required a bean of type 解决方法

    我在其他Controller中调了其他Service方法,但是报:Field eFaultPriorityService in com.ect.emes.admin.restapi.AlarmRest ...

  5. Field xxxMapper in xxxServiceImpl required a bean of type XxxMapper解决方法

    写一个项目,启动之后无报错就结束了,后来发现是日志配置问题.改了之后出现了"Field stuService in a.imooc.controller.StuController requ ...

  6. 【Field xx in xxx.xx.xx required a bean of type ‘xx.xx.xx‘ that could not be found】排查和解决办法

    解决springboot启动报以下错误的解决办法 问题现象 解决办法 总结 Field testMapper in com.micro.test.TestServiceImpl required a ...

  7. 解决:Parameter 0 of constructor in XXX required a bean of type ‘XXX‘ that could not be found

    解决:Parameter 0 of constructor in com.mise.smart.entity.HrmNoticeEntity required a bean of type 'java ...

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

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

  9. A component required a bean of type ‘XXX‘ that could not be found 解决办法

    springboot应用启动的时候,bean的加载扫描失败,错误信息如下A component required a bean of type 'XXX' that could not be foun ...

  10. Parameter 1 of constructor in xxx required a bean of type xxx‘ that could not be found.已经解决

    使用Mybatis Plus 时遇到问题Parameter 1 of constructor in xxx required a bean of type xxx' that could not be ...

最新文章

  1. Ubuntu下安装Stanford CoreNLP
  2. python版mapreduce题目实现寻找共同好友
  3. Python中的字典排序
  4. Java Web之SpringMVC 进行数据回显
  5. 【Python教程】 正则表达式 re模块中,反斜杠 “\“分割字符串的正确操作方法
  6. [云炬创业基础笔记]盈利构造
  7. mysql中的dump,从mysql中dump数据到本地
  8. 萌新的Python练习实例100例(五)输入三个整数x,y,z,请把这三个数由小到大输出。
  9. ego电商项目:Rmi远程服务发布
  10. 解决Win7的svchost进程占内存过大,计算机运行过慢的方法
  11. 计算机系统中的数据计量单位-位(bit)、字节(Byte)、字(word)
  12. jena使用 java_【jena】 jena基本使用
  13. aps是什么意思_aps画幅是什么意思
  14. 如何制作一封高打开率的邮件?
  15. The color “baseBlac in values has no declaration in the base values folder this can lead to crash
  16. 商汤提出手机端实时单目三维重建系统,实现逼真AR效果和交互
  17. 计算机视觉这个专业怎么样?
  18. Traefik-ingress和Nginx-ingress对比
  19. mermaid sequenceDiagram使用指南
  20. 基于ssm+maven+idea的滴滴网络租车系统设计与实现

热门文章

  1. C#自定义控件添加至工具箱的方法
  2. 文曲星猜数字游戏java代码_文曲星猜数字游戏6步算法(含代码)
  3. 伦斯勒理工学院计算机科学专业强吗,伦斯勒理工学院有哪些专业处于世界顶尖水平?...
  4. 七个问题透视百度智慧商业平台
  5. 数据中心 服务器 电压,数据中心和通信机房,需要这样的功率器件……
  6. java publisher_Publisher/Subscriber(发布/订阅者)消息模式开发流程
  7. 激光视觉惯导融合的slam系统
  8. FatalThrowableError in Encrypter.php line 66: Call to undefined function openssl_encrypt()
  9. 对抗机器学习论文-Towards Deep Learning Models Resistant to Adversarial Attacks(PGD)
  10. linux命令获取reboot信息,linux的reboot命令