Я пытаюсь аннотировать класс SecurityWebFilterChain с помощью @EnableWebFluxSecurity:
@EnableWebFluxSecurity
public class AccessIqWebSecurityConfigurerAdapter {
Я получаю следующую ошибку при загрузке приложения:
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.security.config.annotation.web.reactive.WebFluxSecurityConfiguration': Unsatisfied dependency expressed through field 'securityWebFilterChains'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'springSecurityFilterChain' defined in class path resource [com/config/AccessIqWebSecurityConfigurerAdapter.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.security.web.server.SecurityWebFilterChain]: Factory method 'springSecurityFilterChain' threw exception; nested exception is java.lang.IllegalArgumentException: clientRegistrationRepository cannot be null
Когда я удаляю compile("org.springframework.boot:spring-boot-starter-web"). Оно работает. но мне нужен compile("org.springframework.boot:spring-boot-starter-web") для чванства, Mockmvc и т. д. есть идеи?





Как указано в справочной документации, добавление зависимости spring-boot-starter-web к вашему приложению сообщит Spring Boot о необходимости настроить его как приложение Spring MVC.
Вы можете дать Spring Boot еще одну подсказку, чтобы сделать его по-прежнему приложением Spring WebFlux (через SpringApplication.setWebApplicationType(WebApplicationType.REACTIVE)), но в вашем случае это не поможет: