You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the application fails to start because the instantiated PublisherAnnotationBeanPostProcessorrequests itself as a bean.
By default, Spring Boot disallows this unless you set spring.main.allow-circular-references: true, which IMO you shouldn't do without a good reason.
Expected behavior
No circular dependency error should be raised.
PublisherAnnotationBeanPostProcessor could still check for a duplicate with an explicit bean request;
perhaps just checking whether a definition exists would be enough.
The text was updated successfully, but these errors were encountered:
2021-12-14 10:18:17.182 ERROR 3896 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
The dependencies of some of the beans in the application context form a cycle:
┌──->──┐
| org.springframework.integration.internalPublisherAnnotationBeanPostProcessor
└──<-──┘
Fixesspring-projects#3694
* Move check for `PublisherAnnotationBeanPostProcessor` bean into the
`SmartInitializingSingleton.afterSingletonsInstantiated()` to break a circular dependency revealed
in the `InitializingBean.afterPropertiesSet()`
* GH-3694: Resolve circular dep in PublisherAnnBPP
Fixes#3694
* Move check for `PublisherAnnotationBeanPostProcessor` bean into the
`SmartInitializingSingleton.afterSingletonsInstantiated()` to break a circular dependency revealed
in the `InitializingBean.afterPropertiesSet()`
* * Fix unused import
If I declare the following configuration class in a Spring Boot application:
the application fails to start because the instantiated
PublisherAnnotationBeanPostProcessor
requests itself as a bean.By default, Spring Boot disallows this unless you set
spring.main.allow-circular-references: true
, which IMO you shouldn't do without a good reason.Expected behavior
No circular dependency error should be raised.
PublisherAnnotationBeanPostProcessor
could still check for a duplicate with an explicit bean request;perhaps just checking whether a definition exists would be enough.
The text was updated successfully, but these errors were encountered: