Skip to content

BeanPostProcessors not registered correctly when ProblemSecurityAutoConfiguration bean instantiated in auto-configuration #953

@dataGeeek

Description

@dataGeeek

When adding the problem-spring-web-starter to a spring.boot project above version 3.2.0, the following WARN statement is logged during application startup:

2024-02-05T14:05:32.719+01:00 WARN 13788 --- [unknown-service] [ Test worker] trationDelegate$BeanPostProcessorChecker : Bean 'org.zalando.problem.spring.web.autoconfigure.security.ProblemSecurityAutoConfiguration' of type [org.zalando.problem.spring.web.autoconfigure.security.ProblemSecurityAutoConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). The currently created BeanPostProcessor [problemSecurityBeanPostProcessor] is declared through a non-static factory method on that class; consider declaring it as static instead.

We could not observe a broken behavior, however this log statement is annoying, since we try to keep our log clean.
Please fix.

Description

see above

Expected Behavior

No warn-logs at startup as this pollutes our logs

Actual Behavior

see above

Possible Fix

See how other project deal with it: spring-cloud/spring-cloud-commons#1315

Steps to Reproduce

  1. Create spring boot project e.g. via Spring Initializr with version 3.2.0
  2. Add org.zalando:problem-spring-web-starter: in latest version to the dependencies
  3. Start spring context (e.g. via Application Test). The log statement is printed

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions