SpringBean instantiation via constructor failed nested exception Constructor threw exception

Posted 九师兄

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了SpringBean instantiation via constructor failed nested exception Constructor threw exception相关的知识,希望对你有一定的参考价值。

1.概述

我今天一个程序报错依赖异常。错误信息如下 Caused by:UnsatisfiedDependencyException: Error creating bean with name \'extensionServiceImpl\': Unsatisfied dependency expressed through field \'zkService\'; nested exception is BeanCreationException: Error creating bean with name \'zkService\' defined in URL [xxx.jar!/xxx/ZkService.class]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.dbapp.baas.monitor.infrastructure.ZkService]: Constructor threw exception; nested exception is java.lang.NullPointerException

先说一下我的代码结构

原本的代码结构如下。

以上是关于SpringBean instantiation via constructor failed nested exception Constructor threw exception的主要内容,如果未能解决你的问题,请参考以下文章

Spring我可以讲半小时

Spring Bean生命周期

spring bean初始化耗时统计

Instantiate实例化的注意事项

Unity创建或克隆对象 Instantiate()

Unity中Instantiate一个prefab时需要注意的问题