当前位置:
首页 >
行业知识 >
SpringBoot项目启动报错:Injection of resource dependencies failed; nested exception is org.springframework
行业知识
SpringBoot项目启动报错:Injection of resource dependencies failed; nested exception is org.springframework
2026-11-04 05:22:43
来源:互联网转载
bean注入失败,报错如下:
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'AAAImpl': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'BBBImpl': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'FFFImpl': Unsatisfied dependency expressed through field 'nnService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'xxxService': Lookup method resolution failed; nested exception is java.lang.IllegalStateException: Failed to introspect Class [XXXService] from ClassLoader [sun.misc.Launcher$AppClassLoader@58644d46]at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessProperties(CommonAnnotationBeanPostProcessor.java:332)at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1431)at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:619)at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean
- 检查注入的对象名是否为类名一致(首字母小写)
只index.php/tags-602.html" >使用@Autowired时,需要保证注解的对象名和注解类名一致,
注意: 首字母要小写,且注解时没有命名
解决:
方法1:优化代码,去掉互相注入的情况
方法2:使用注解,@Lazy(true)
上一篇:滑稽服务器怎么样?