question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ConfigurationClassPostProcessor cannot enhance bean "refreshScope"

See original GitHub issue
WARN [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:closed
  • Created 7 years ago
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

9reactions
janlissecommented, Nov 2, 2016

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.

5reactions
mmoayyedcommented, May 14, 2016

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found