Skip to content

Unexpected warn logs when using spring-integration in combination with webmvc #9103

Closed
@epantke

Description

@epantke

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 or mvc:annotation-driven the following warnings are shown:

26-Apr-2024 14:24:48.960 WARNING [RMI TCP Connection(2)-127.0.0.1] org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization Bean '(inner bean)#597faa00' of type [org.springframework.web.servlet.resource.ResourceUrlProvider] 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.
26-Apr-2024 14:24:48.965 WARNING [RMI TCP Connection(2)-127.0.0.1] org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization Bean '(inner bean)#218f313c' of type [org.springframework.web.servlet.resource.ResourceUrlProviderExposingInterceptor] 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.
26-Apr-2024 14:24:49.086 WARNING [RMI TCP Connection(2)-127.0.0.1] org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization Bean '(inner bean)#1ef73af4' 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.

When using only one of the elements only a subset of these warning appear. With mvc:resources the warning for the ResourceUrlProvider and ResourceUrlProviderExposingInterceptor are logged. With mvc:annotation-driven the warning for the ConversionServiceExposingInterceptor is shown.

The spring framework (6.1.6) documentation states that having dependencies in BPPs is not recommended and might cause issues.

If you have beans wired into your BeanPostProcessor by using autowiring or @resource (which may
fall back to autowiring), Spring might access unexpected beans when searching for type-matching
dependency candidates and, therefore, make them ineligible for auto-proxying or other kinds of
bean post-processing
Spring Framework Docs

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

  • Build the sample project in the attached zip.
  • Deploy the war in a matching web server (we used Tomcat 10.1.20)
  • Observe the warnings in the logs.
    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions