这个问题可能有好些原因,不同的项目有不同的原因。
今天遇到是在导入处理阿里云OSS包的时候出现的,提示:
required a bean of type ' objectstorage.ObjectStorageClient' that could not be found.
这个问题的原因是包扫描不到!
解决方法,在启动类上面添加注解:
@ComponentScan(basePackages="com.onecodeall")
ObjectStorageClient 在这个包com.onecodeall的子包下面。