ConfigurationClassPostProcessor cannot enhance bean "refreshScope"
See original GitHub issueWARN [org.springframework.context.annotation.ConfigurationClassPostProcessor] -
<Cannot enhance @Configuration bean definition 'refreshScope' 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'.>
Seeing this with Spring 2.4.6. Recently upgraded from 1.0.4.RELEASE where this warning was non-apparent. Is this something to be concerned about?
Issue Analytics
- State:
- Created 7 years ago
- Comments:15 (6 by maintainers)
Top Results From Across the Web
SpringBoot Cannot enhance @Configuration bean definition ...
I recently started getting this warning on start up of my Spring Boot application: o.s.c.a.ConfigurationClassPostProcessor - Cannot enhance ...
Read more >spring-cloud/spring-cloud - Gitter
2017-03-09 09:11:09.069 WARN 1 --- [ main] o.s.c.a.ConfigurationClassPostProcessor : Cannot enhance @Configuration bean definition 'refreshScope' since its ...
Read more >Cannot enhance @Configuration bean definition
While running Axon SprinBoot application, I get this INFO message at the very start: o.s.c.a.ConfigurationClassPostProcessor : Cannot ...
Read more >[hawkbit-dev] problem installing hawkbit - Eclipse
[hawkbit-dev] problem installing hawkbit ... Cannot enhance @Configuration bean definition 'refreshScope' since its singleton instance has been created too ...
Read more >spring-boot-starter-web: Unable to start embedded Tomcat
AnnotationConfigApplicationContext@5c0369c4 09:01:04.202 [main] WARN o.s.c.a.ConfigurationClassPostProcessor - Cannot enhance @Configuration bean definition ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
In our App which i would subsume under “sufficiently complex”, this is the ONLY warning that is logged during startup. Besides that you are right, the original question was a little bit different. Nevertheless i think it is a bad practice having WARN’s logged out that ought to be ignored. And finally there might be a reason why the Spring people introduced it and it might indicate improper usage.
Turns out this isnt quite solved: I removed all traces of @RefreshScope from all @Configuration classes, and ran a global search to ensure. I still see the log warning message.