Skip to content

Setting order programmatically on OncePerRequestFilter or HandlerExceptionResolver beans using BeanRegistrar or GenericApplicationContext does not work #36637

@hajdamak

Description

@hajdamak

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions