-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpected warn logs when using spring-integration in combination with webmvc #9103
Comments
Thank you for the report.
Because I indeed have there the mentioned Will investigate the reason and come up with the fix. |
The problem happens in the
And since this I think as a fix I'll extract that |
Fixes: #9103 The `IntegrationRequestMappingHandlerMapping` implements a `DestructionAwareBeanPostProcessor` which causes an early bean initialization including interceptors loading from the application context: ``` 2024-04-26 12:11:07,434 WARN [main] [org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker] - Bean '(inner bean)#39f5b723' of type [org.springframework.web.servlet.handler.ConversionServiceExposingInterceptor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [integrationRequestMappingHandlerMapping]? Check the corresponding BeanPostProcessor declaration and its dependencies. ``` * Extract the `DestructionAwareBeanPostProcessor` logic from the `IntegrationRequestMappingHandlerMapping` into separate `DynamicRequestMappingBeanPostProcessor` which does not cause eager beans initialization * Verify with the `IntegrationGraphControllerTests` that the mentioned `not eligible for auto-proxying` warning is not emitted anymore (cherry picked from commit 5d59271)
Fixes: spring-projects#9103 The `IntegrationRequestMappingHandlerMapping` implements a `DestructionAwareBeanPostProcessor` which causes an early bean initialization including interceptors loading from the application context: ``` 2024-04-26 12:11:07,434 WARN [main] [org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker] - Bean '(inner bean)#39f5b723' of type [org.springframework.web.servlet.handler.ConversionServiceExposingInterceptor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [integrationRequestMappingHandlerMapping]? Check the corresponding BeanPostProcessor declaration and its dependencies. ``` * Extract the `DestructionAwareBeanPostProcessor` logic from the `IntegrationRequestMappingHandlerMapping` into separate `DynamicRequestMappingBeanPostProcessor` which does not cause eager beans initialization * Verify with the `IntegrationGraphControllerTests` that the mentioned `not eligible for auto-proxying` warning is not emitted anymore **Auto-cherry-pick to `6.2.x`**
In what version(s) of Spring Integration are you seeing this issue?
6.2.4
Describe the bug
When using spring-integration in combination with the xml elements from the webmvc xml namespace
mvc:resources
ormvc:annotation-driven
the following warnings are shown:When using only one of the elements only a subset of these warning appear. With
mvc:resources
the warning for theResourceUrlProvider
andResourceUrlProviderExposingInterceptor
are logged. Withmvc:annotation-driven
the warning for theConversionServiceExposingInterceptor
is shown.The spring framework (6.1.6) documentation states that having dependencies in BPPs is not recommended and might cause issues.
These log messages pollute the logs in any application using spring-integration this way; making it harder to identify the warnings that concern the application code and the beans defined within.
To Reproduce
warn-minimal-example.zip
Expected behavior
When using spring-integration in combination with spring-webmvc, no warnings are produced by the dependencies included.
Sample
warn-minimal-example.zip
The text was updated successfully, but these errors were encountered: