Destroy method on bean with name 'org.springframework.boot.autoconfigure.internalCachingMetadataRead

Destroy method on bean with name 'org.springframework.boot.autoconfigure.internalCachingMetadataReaderFactory' threw an exception

 ERROR o.s.b.f.s.DefaultSingletonBeanRegistry [main] Destroy method on bean with name 'org.springframework.boot.autoconfigure.internalCachingMetadataReaderFactory' threw an exception
java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@5f9b2141: startup date [Tue Jul 24 10:51:17 CST 2018]; root of context hierarchy
    at org.springframework.context.support.AbstractApplicationContext.getApplicationEventMulticaster(AbstractApplicationContext.java:404) ~[spring-context-4.3.8.RELEASE.jar:4.3.8.RELEASE]
    at org.springframework.context.support.ApplicationListenerDetector.postProcessBeforeDestruction(ApplicationListenerDetector.java:97) ~[spring-context-4.3.8.RELEASE.jar:4.3.8.RELEASE]
    at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:253) ~[spring-beans-4.3.8.RELEASE.jar:4.3.8.RELEASE]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:578) [spring-beans-4.3.8.RELEASE.jar:4.3.8.RELEASE]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:554) [spring-beans-4.3.8.RELEASE.jar:4.3.8.RELEASE]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingleton(DefaultListableBeanFactory.java:961) [spring-beans-4.3.8.RELEASE.jar:4.3.8.RELEASE]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:523) [spring-beans-4.3.8.RELEASE.jar:4.3.8.RELEASE]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingletons(DefaultListableBeanFactory.java:968) [spring-beans-4.3.8.RELEASE.jar:4.3.8.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1033) [spring-context-4.3.8.RELEASE.jar:4.3.8.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:555) [spring-context-4.3.8.RELEASE.jar:4.3.8.RELEASE]
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) [spring-boot-1.5.3.RELEASE.jar:1.5.3.RELEASE]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:737) [spring-boot-1.5.3.RELEASE.jar:1.5.3.RELEASE]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:370) [spring-boot-1.5.3.RELEASE.jar:1.5.3.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:314) [spring-boot-1.5.3.RELEASE.jar:1.5.3.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1162) [spring-boot-1.5.3.RELEASE.jar:1.5.3.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1151) [spring-boot-1.5.3.RELEASE.jar:1.5.3.RELEASE]
    at 

 

个人遇到的原因是:

未导入相应的jar包。。。

        <dependency>
            <groupId>com.dangdang</groupId>
            <artifactId>config-toolkit</artifactId>
            <version>3.3.0-RELEASE</version>
        </dependency>

 

  • 2
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
### 回答1: bean名称为'org.springframework.boot.autoconfigure.internalcachingmetadatareaderfactory'的destroy方法抛出了异常。 ### 回答2: Bean名称为'org.springframework.boot.autoconfigure.internalcachingmetadatareaderfactory '上的销毁方法抛出了异常。 在Spring框架中,当一个Bean被销毁时,可以定义一个销毁方法来执行一些清理工作。在这种情况下,名为'org.springframework.boot.autoconfigure.internalcachingmetadatareaderfactory'的Bean的销毁方法发生了异常。 出现此异常的原因可能是在销毁方法内部发生了一些错误。可能是由于无效的代码逻辑、错误的调用方法、未捕获的异常等导致的。 为了解决这个问题,我们可以进行以下步骤: 1. 检查销毁方法的实现,确保其逻辑正确且没有错误。 2. 确保销毁方法内部的代码调用是正确的,并且没有出现错误的方法调用。 3. 检查是否有任何未捕获的异常可能导致了此异常的抛出。如果有,我们应该处理这些异常,或者使用try-catch语句捕获它们,并给出适当的处理方式。 4. 如果可能的话,查看相关日志文件,以获取更多关于异常的详细信息,以便更好地了解问题所在。 总之,解决这个问题需要我们认真检查并确定销毁方法的实现和调用是否正确,并处理任何可能导致异常的问题。 ### 回答3: 在Spring框架中,当我们使用注解@Configuration和@EnableAutoConfiguration配置一个应用程序时,会自动加载一组预定义的自动配置类。这些自动配置类负责加载所需的bean,并对它们进行配置。在这个过程中,可能会出现一些异常。 这个异常"destroy method on bean with name 'org.springframework.boot.autoconfigure.internalcachingmetadatareaderfactory' threw an exception"是由于在销毁名为'org.springframework.boot.autoconfigure.internalcachingmetadatareaderfactory'的bean时,其销毁方法产生了异常。 造成这个问题可能的原因有很多,下面列举几种可能的原因和解决方法: 1. 配置错误:可能是由于配置的错误导致的。检查相关的配置是否正确,并确保正确引入了所需的依赖。 2. 版本不匹配:有时,不同的库和组件具有不同的版本要求,可能会导致冲突。检查所有所使用的库和组件的版本是否匹配,并尝试将其升级到最新版本。 3. 缺少依赖:可能是由于缺少某些依赖项而导致的。查看异常信息中提到的类是否是通过Maven、Gradle或其他依赖管理工具引入的,并确保已正确导入或添加了相应的依赖项。 4. 代码问题:有时,异常可能是由于自己编写的代码问题导致的,例如错误的配置、错误的使用方法等。仔细检查代码,并确保没有编写任何不正确的代码。 总结:根据异常信息中提供的信息,结合以上的可能原因和解决方法,可以尝试逐一排查和解决问题。如果问题仍然存在,可以进行进一步的调查和日志分析,以确定真正的原因并采取相应的措施。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值