1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/stylefeng-Roses-roses-kernel

 / Детали:

@Bean("error") в WebAutoConfiguration не может быть внедрен

Предстоит сделать
Владелец
Создано  
28.11.2024

При запуске @SpringBootTest возникает ошибка загрузки ApplicationContext.
Однако при запуске @SpringBootApplication проблем нет.

Ошибка @SpringBootTest:
roses "error" bean конфликтует с ErrorMvcAutoConfiguration.WhitelabelErrorViewConfiguration error bean

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

Description:

The bean 'error', defined in class path resource [cn/stylefeng/roses/core/config/WebAutoConfiguration.class], could not be registered. A bean with that name has already been defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/error/ErrorMvcAutoConfiguration$WhitelabelErrorViewConfiguration.class] and overriding is disabled.

Action:

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

===2019-08-23 13:26:30.027 ERROR org.springframework.test.context.TestContextManager Line:250 - Caught exception while allowing TestExecutionListener [org.springframework.test.context.web.ServletTestExecutionListener@266374ef] to prepare test instance [net.aas.demo.SpringBootFastApplicationTests@2e807c54]

Затем я отладил вывод и обнаружил, что только defaultErrorView был сопоставлен, а GlobalErrorView roses не был введен, почему это так?
Основной метод main работает без ошибок,
метод модульного тестирования не работает

Комментарий (0)

GitLife Service Account Задача создана

Вход Перед тем как оставить комментарий

Статус
Ответственный
Контрольная точка
Pull Requests
Связанные запросы на слияние могут быть закрыты после их объединения
Ветки
Дата начала   -   Крайний срок
-
Закрепить/Открепить
Приоритет
Участники(1)
1
https://api.gitlife.ru/oschina-mirror/stylefeng-Roses-roses-kernel.git
git@api.gitlife.ru:oschina-mirror/stylefeng-Roses-roses-kernel.git
oschina-mirror
stylefeng-Roses-roses-kernel
stylefeng-Roses-roses-kernel