org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'documents': Unsatisfied dependency expressed through field 'documentService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'documentService': Unsatisfied dependency expressed through field 'fs'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'fileSystem' defined in starter.StarterApplication: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [starter.service.fs.FileSystem]: Factory method 'fileSystem' threw exception; nested exception is java.lang.NullPointerException
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:588)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:366)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1264)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBea
Exception encountered during context initialization - cancelling refresh attempt
最新推荐文章于 2024-07-04 19:04:24 发布
在尝试为Spring Boot项目添加Lombok并更新实体类后,项目启动失败,出现'Exception encountered during context initialization'错误,具体表现为Bean注入时抛出空指针异常。经过排查,发现问题是实体类中一个常量类型从Long改为long导致,改回原样后问题解决。然而,错误提示并未直接指出这一问题,给定位带来了困难。
摘要由CSDN通过智能技术生成