Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HandlerMappingIntrospectorRequestTransformer is registered twice in AOT #14362

Closed
marcusdacoregio opened this issue Dec 21, 2023 · 3 comments
Closed
Assignees
Labels
in: web An issue in web modules (web, webmvc) type: bug A general bug
Milestone

Comments

@marcusdacoregio
Copy link
Contributor

marcusdacoregio commented Dec 21, 2023

The new changes added via #14128 introduced a BeanDefinitionRegistryPostProcessor that, among other things, register a HandlerMappingIntrospectorRequestTransformer bean.

The problem arises from the fact that the BeanFactoryPostProcessors are invoked during AOT processing and once more at runtime, leading to a duplicate bean exception.

Usually org.springframework.beans.factory.config.BeanFactoryPostProcessor beans are excluded since they have contributed their bean definitions code generated during AOT build phase.

Related:

@marcusdacoregio marcusdacoregio added in: web An issue in web modules (web, webmvc) type: bug A general bug labels Dec 21, 2023
@marcusdacoregio marcusdacoregio added this to the 6.1.7 milestone Dec 21, 2023
@marcusdacoregio marcusdacoregio self-assigned this Dec 21, 2023
marcusdacoregio added a commit that referenced this issue Dec 26, 2023
…stProcessor passive

Instead of excluding the bean from AOT processing, we avoid redefining the beans if they are present or in the expected state.

Issue gh-14362
@mraible
Copy link
Contributor

mraible commented Jan 5, 2024

@marcusdacoregio Do you know if this fix will be included in a release of Spring Boot before January 16? I'm trying to decide if I should use Spring Boot 3.2.0 or wait for 3.2.2 for a presentation I'm doing on that date.

@marcusdacoregio
Copy link
Contributor Author

marcusdacoregio commented Jan 5, 2024

Hi, @mraible. Unfortunately no, this will be included in the next patch releases that will occur on February 19th and will probably be picked up by Spring Boot 3.2.3 in February 21st. An alternative is to use Spring Boot 3.2.2 and override the Spring Security version to use a SNAPSHOT.

@theotherp
Copy link

Unfortunately this doesn't work for me. spring-security-config-6.3.0-20240110.101431-124 does not contain the changes from 8a93178.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web An issue in web modules (web, webmvc) type: bug A general bug
Projects
Status: No status
Development

No branches or pull requests

3 participants