【已解决】No qualifying bean of type ‘service.Service‘ available
作者:互联网
Exception in thread “main” org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type ‘service.Service’ available
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:351)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:342)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1172)
at com.text.main.Main.main(Main.java:13)
错误原因:无法扫描service.service包,意思就是import导入的service包下的service类无法被扫描
解决方法:查看自己的包路径是否错误,或者包的位置是否错误
我的错误:我这里的service包放在了扫描包的外面,所以无法扫描
出错时
解决后
标签:available,java,Service,service,getBean,springframework,DefaultListableBeanFactor 来源: https://blog.csdn.net/LongLiveThePRC/article/details/123227410