If you annotate your OncePerRequestFilter or HandlerExceptionResolver beans with @Order annotation that is registered programmatically using BeanRegistrar or GenericApplicationContext, it works correctly. Order value provided in @Order annotation influences order of filter or resolver.
However if you instead provide order value in registerBean's order parameter in case of BeanRegistrar or if you set AbstractBeanDefinition.ORDER_ATTRIBUTE in case of GenericApplicationContext , this value has no influence on filter or resolver order.
SpringBoot 4.0.3
JDK 25
Kotlin 2.3
If you annotate your
OncePerRequestFilterorHandlerExceptionResolverbeans with@Orderannotation that is registered programmatically usingBeanRegistrarorGenericApplicationContext, it works correctly. Order value provided in@Orderannotation influences order of filter or resolver.However if you instead provide order value in
registerBean'sorderparameter in case ofBeanRegistraror if you setAbstractBeanDefinition.ORDER_ATTRIBUTEin case ofGenericApplicationContext, this value has no influence on filter or resolver order.SpringBoot 4.0.3
JDK 25
Kotlin 2.3