-
Notifications
You must be signed in to change notification settings - Fork 41.5k
Closed as not planned
Labels
status: invalidAn issue that we don't feel is validAn issue that we don't feel is valid
Description
Using Spring Boot 3.1.0, I cannot create a bean named "localeResolver" with type LocalResolver
. When application starts, I get the following:
The bean 'localeResolver', defined in class path resource [path/to/MyConfiguration.class], could not be registered. A bean with that name has already been defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class] and overriding is disabled.
And I'm defining LocaleResolver
bean like that:
@Configuration
@EnableConfigurationProperties({SomePropertiesClasses})
public class MyConfiguration {
private final MyClass myClass;
public MessagesConfiguration(MyClass myClass) {
this.myClass = myClass;
}
@Bean
public LocaleResolver localeResolver() {
// ...
}
}
Without setting spring.main.allow-bean-definition-overriding=true
I want to define a LocaleResolver
bean.
Note: I don't have @EnableWebMvc
annotation in my code.
Metadata
Metadata
Assignees
Labels
status: invalidAn issue that we don't feel is validAn issue that we don't feel is valid