zalando / problem-spring-web

A library for handling Problems in Spring Web MVC
MIT License
1.04k stars 126 forks source link

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

Open dataGeeek opened 9 months ago

dataGeeek commented 9 months ago

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: https://github.com/spring-cloud/spring-cloud-commons/issues/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
AntonioCastilloPerez commented 8 months ago

We have the same problem. Are there any fixes planned yet ?