BeanDefinitionOverrideException, хотя переопределение Spring-Property включено - PullRequest
0 голосов
/ 05 мая 2020

Хотя свойство spring allow-bean-definition-overriding: true включено в основном application.yml, я получаю исключение. Любая подсказка, почему?

Запуск приложения

***************************
APPLICATION FAILED TO START
***************************

Description:

The bean 'httpSessionManager', defined in class path resource [...], could not be registered. A bean with that name has already been defined in URL [...HttpSessionManager.class] and overriding is disabled.

Action:

Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true

Запуск теста

***************************
APPLICATION FAILED TO START
***************************

Description:

The bean 'metaDataSourceAdvisor' could not be registered. A bean with that name has already been defined and overriding is disabled.

Action:

Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true

1 Ответ

1 голос
/ 05 мая 2020

Если вы посмотрите на сообщение об ошибке, оно говорит:

Рассмотрите возможность переименования одного из компонентов или включения переопределения, установив spring.main.allow-bean-definition-overriding = true. *

Убедитесь, что ваше свойство allow-bean-definition-overriding находится под элементом spring.main.

...