【问题标题】:SpringBoot Cannot enhance @Configuration bean definition 'beanNamePlaceholderRegistryPostProcessor'Spring Boot无法增强@Configuration bean定义'beanNamePlaceholderRegistry PostProcessor'
【发布时间】:2017-04-05 04:08:27
【问题描述】:

我最近开始在我的 Spring Boot 应用程序启动时收到此警告:

o.s.c.a.ConfigurationClassPostProcessor - 无法增强 @Configuration bean 定义 'beanNamePlaceholderRegistryPostProcessor' 因为它的单例 实例创建得太早。典型原因是非静态 带有 BeanDefinitionRegistryPostProcessor 返回类型的 @Bean 方法: 考虑将此类方法声明为“静态”。

我不知道它是从哪里来的。我的应用程序中没有这样的类('beanNamePlaceholderRegistryPostProcessor'、'BeanDefinitionRegistryPostProcessor'),所以我不确定如何防止这种情况发生。

有人有什么想法吗?

这个问题与this one 略有不同,因为它似乎与用户创建的类有关。

【问题讨论】:

    标签: spring-boot


    【解决方案1】:

    我终于发现 beanNamePlaceholderRegistryPostProcessor 是 Jasypt Spring Boot 启动包的一部分。

    我提出了一个问题,作者立即回复,表示没有什么可担心的。

    https://github.com/ulisesbocchio/jasypt-spring-boot/issues/45

    如果您愿意,可以通过将以下内容添加到 Logback(如果您使用它)来忽略警告:

    <logger name="org.springframework.context.annotation.ConfigurationClassPostProcessor" level="ERROR"/>
    

    【讨论】:

      猜你喜欢
      • 2020-05-22
      • 1970-01-01
      • 1970-01-01
      • 2016-09-10
      • 2020-08-26
      • 2021-03-01
      • 1970-01-01
      • 2014-03-27
      • 1970-01-01
      相关资源
      最近更新 更多