ulisesbocchio / jasypt-spring-boot

Jasypt integration for Spring boot
MIT License
2.91k stars 522 forks source link

Spring Boot warning for com.ulisesbocchio.jasyptspringboot.configuration.EncryptablePropertyResolverConfiguration #44

Closed NishantHadole closed 7 years ago

NishantHadole commented 7 years ago

Spring Boot version: 1.5.1.RELEASE jasypt-spring-boot-starter version: 1.11

We see this warning every-time we run the application, although it does not affect the functionality. May be you can investigate the cause and fix it.

WARN o.s.c.a.ConfigurationClassPostProcessor - Cannot enhance @Configuration bean definition 'beanNamePlaceholderRegistryPostProcessor' since its singleton instance has been created too early. The typical cause is a non-static @Bean method with a BeanDefinitionRegistryPostProcessor return type: Consider declaring such methods as 'static'.

ulisesbocchio commented 7 years ago

It's been around for a while. If you look at EncryptablePropertyResolverConfiguration.beanNamePlaceholderRegistryPostProcessor it is a static @Bean declaration, so it seems like the warning is incorrectly logged. The warning states that be bean definition should be static and in fact it is since it needs to be static because it's a BeanDefinitionRegistryPostProcessor that needs to be picked up as early as possible in the bootstrap process. You can turn off the warning by adding this to your configuration:

logging.level:
  org.springframework.context.annotation.ConfigurationClassPostProcessor: off
NishantHadole commented 7 years ago

@ulisesbocchio Thanks for clarification.