SpringBoot启动报错:org.springframework.beans.factory.UnsatisfiedDependencyException Error creating bean

本文分析了SpringBoot启动时遇到的UnsatisfiedDependencyException,问题源于IDEA编译器故障导致faxService创建失败,进而影响faxController的bean创建。错误堆栈显示了从faxController到faxService的依赖注入失败,由于构造函数异常引发的ExceptionInInitializerError。解决此问题需要检查并修复 FaxService 的构造函数和相关配置。
摘要由CSDN通过智能技术生成

SpringBoot启动报错:org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘faxController’:Unsatisfied dependency expressed through field ‘faxService’

分析:
由于IDEA编译器故障,导致faxService创建失败,faxController中注入了faxService,最终Spring创建该bean faxController 失败。

错误复现:
2022-03-10 16:32:07.420 [main] ERROR org.springframework.boot.SpringApplication - Application run failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘faxController’: Unsatisfied dependency expressed through field ‘faxService’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘faxService’ defined in file [E:liveapache-tomcat-9.0.46webappsycWEB-INFclassescomliveplatformlive axserviceFaxService.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.live.platform.live.fax.service.FaxService]: Constructor threw exception; nested exception is java.lang.ExceptionInInitializerError
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor A u t o w i r e d F i e l d E l e m e n t . i n j e c t ( A u t o w i r e d A n n o t a t i o n B e a n P o s t P r o c e s s o r . j a v a : 639 ) a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . a n n o t a t i o n . I n j e c t i o n M e t a d a t a . i n j e c t ( I n j e c t i o n M e t a d a t a . j a v a : 116 ) a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . a n n o t a t i o n . A u t o w i r e d A n n o t a t i o n B e a n P o s t P r o c e s s o r . p o s t P r o c e s s P r o p e r t i e s ( A u t o w i r e d A n n o t a t i o n B e a n P o s t P r o c e s s o r . j a v a : 397 ) a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . p o p u l a t e B e a n ( A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . j a v a : 1429 ) a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . d o C r e a t e B e a n ( A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . j a v a : 594 ) a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . c r e a t e B e a n ( A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . j a v a : 517 ) a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t B e a n F a c t o r y . l a m b d a AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:639) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:116) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:397) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1429) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:639)atorg.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:116)atorg.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:397)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1429)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517)atorg.springframework.beans.factory.support.AbstractBeanFactory.lambdadoGetBean 0 ( A b s t r a c t B e a n F a c t o r y . j a v a : 323 ) a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . D e f a u l t S i n g l e t o n B e a n R e g i s t r y . g e t S i n g l e t o n ( D e f a u l t S i n g l e t o n B e a n R e g i s t r y . j a v a : 222 ) a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t B e a n F a c t o r y . d o G e t B e a n ( A b s t r a c t B e a n F a c t o r y . j a v a : 321 ) a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t B e a n F a c t o r y . g e t B e a n ( A b s t r a c t B e a n F a c t o r y . j a v a : 202 ) a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . D e f a u l t L i s t a b l e B e a n F a c t o r y . p r e I n s t a n t i a t e S i n g l e t o n s ( D e f a u l t L i s t a b l e B e a n F a c t o r y . j a v a : 879 ) a t o r g . s p r i n g f r a m e w o r k . c o n t e x t . s u p p o r t . A b s t r a c t A p p l i c a t i o n C o n t e x t . f i n i s h B e a n F a c t o r y I n i t i a l i z a t i o n ( A b s t r a c t A p p l i c a t i o n C o n t e x t . j a v a : 878 ) a t o r g . s p r i n g f r a m e w o r k . c o n t e x t . s u p p o r t . A b s t r a c t A p p l i c a t i o n C o n t e x t . r e f r e s h ( A b s t r a c t A p p l i c a t i o n C o n t e x t . j a v a : 550 ) a t o r g . s p r i n g f r a m e w o r k . b o o t . w e b . s e r v l e t . c o n t e x t . S e r v l e t W e b S e r v e r A p p l i c a t i o n C o n t e x t . r e f r e s h ( S e r v l e t W e b S e r v e r A p p l i c a t i o n C o n t e x t . j a v a : 141 ) a t o r g . s p r i n g f r a m e w o r k . b o o t . S p r i n g A p p l i c a t i o n . r e f r e s h ( S p r i n g A p p l i c a t i o n . j a v a : 747 ) a t o r g . s p r i n g f r a m e w o r k . b o o t . S p r i n g A p p l i c a t i o n . r e f r e s h C o n t e x t ( S p r i n g A p p l i c a t i o n . j a v a : 397 ) a t o r g . s p r i n g f r a m e w o r k . b o o t . S p r i n g A p p l i c a t i o n . r u n ( S p r i n g A p p l i c a t i o n . j a v a : 315 ) a t o r g . s p r i n g f r a m e w o r k . b o o t . w e b . s e r v l e t . s u p p o r t . S p r i n g B o o t S e r v l e t I n i t i a l i z e r . r u n ( S p r i n g B o o t S e r v l e t I n i t i a l i z e r . j a v a : 152 ) a t o r g . s p r i n g f r a m e w o r k . b o o

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值