【问题标题】:org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'personService'org.springframework.beans.factory.BeanCreationException:创建名为“personService”的bean时出错
【发布时间】:2021-11-11 19:26:06
【问题描述】:

我需要帮助以了解我的应用程序中的错误,请帮助我!

错误控制台

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'personController' defined in file [D:\IntelliJ\projetcs\personapi\target\classes\one\digitalinnovation\personapi\controller\PersonController.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'personService' defined in file [D:\IntelliJ\projetcs\personapi\target\classes\one\digitalinnovation\personapi\service\PersonService.class]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [one.digitalinnovation.personapi.service.PersonService]: Constructor threw exception; nested exception is java.lang.ExceptionInInitializerError

【问题讨论】:

    标签: java spring-boot maven heroku-api


    【解决方案1】:

    正如异常消息所说:

    [one.digitalinnovation.personapi.service.PersonService]: Constructor threw exception
    

    PersonService 构造函数抛出异常。仔细检查该构造函数,对其进行调试或在构造函数代码周围加上 try...catch 以记录异常的根本原因

    【讨论】:

    • 我用注解@AllArgsConstructor(onConstructor = @__(@Autowired))
    猜你喜欢
    • 2016-06-05
    • 2020-02-21
    • 2018-04-27
    • 2020-10-20
    • 2020-11-04
    • 2012-07-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多