You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Spring boot 3.2.1 apps including Web-Mvc and Spring security dependency crash in autoconfiguration after building native image with duplicate bean registration of mvcHandlerMappingIntrospector - see log excerpt below.
Used:
Java version: 17.0.9+11-LTS, vendor version: Liberica-NIK-23.0.2-1
[INFO] [creator] Graal compiler: optimization level: 2, target machine: armv8-a
[INFO] [creator] C compiler: gcc (linux, aarch64, 11.4.0)
JVM-started app with Spring Boot 3.2.1 as well as Native image (same Java, Graal, C) with Spring 3.2.0 works fine.
w.s.c.ServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt:
org.springframework.beans.factory.support.BeanDefinitionOverrideException: Invalid bean definition with name
'mvcHandlerMappingIntrospectorRequestTransformer' defined in null: Cannot register bean definition < ..omitted..>
APPLICATION FAILED TO START
Description:
The bean 'mvcHandlerMappingIntrospectorRequestTransformer' could not be registered. A bean with that name has already been defined and overriding is disabled.
My suspicion is a duplicate bean registration in AOT processing, as the generated source file target/spring-aot/main/sources/org/example/ExampleApplication__BeanFactoryRegistrations.java
contains the lines:
Spring boot 3.2.1 apps including Web-Mvc and Spring security dependency crash in autoconfiguration after building native image with duplicate bean registration of
mvcHandlerMappingIntrospector
- see log excerpt below.Used:
Java version: 17.0.9+11-LTS, vendor version: Liberica-NIK-23.0.2-1
[INFO] [creator] Graal compiler: optimization level: 2, target machine: armv8-a
[INFO] [creator] C compiler: gcc (linux, aarch64, 11.4.0)
JVM-started app with Spring Boot 3.2.1 as well as Native image (same Java, Graal, C) with Spring 3.2.0 works fine.
To reproduce it suffices to add Web-MVC and security starter dependency and just one get-endpoint (see example-repo https://github.com/wisskirchenj/example-native
My suspicion is a duplicate bean registration in AOT processing, as the generated source file
target/spring-aot/main/sources/org/example/ExampleApplication__BeanFactoryRegistrations.java
contains the lines:
and the second line is not present, when doing spring-boot:process-aot with version 3.2.0.
EDIT: I saw now, that the class
HandlerMappingIntrospectorRequestTransformer
has been added recently in Spring security 6.2.1.The text was updated successfully, but these errors were encountered: