我想注释SecurityWebFilterChain
类@EnableWebFluxSecurity
:
@EnableWebFluxSecurity
public class AccessIqWebSecurityConfigurerAdapter {
我收到以下错误,同时启动相应的应用:
org.springframework.beans.factory.UnsatisfiedDependencyException:错误创建名为“org.springframework.security.config.annotation.web.reactive.WebFluxSecurityConfiguration”豆:不满意依赖通过现场“securityWebFilterChains”表示;嵌套异常是org.springframework.beans.factory.BeanCreationException:错误创建具有名称豆“springSecurityFilterChain”类路径资源定义[COM /配置/ AccessIqWebSecurityConfigurerAdapter.class]:通过工厂方法豆实例失败;嵌套异常是org.springframework.beans.BeanInstantiationException:无法实例[org.springframework.security.web.server.SecurityWebFilterChain]:出厂方法“springSecurityFilterChain”抛出异常;嵌套的例外是java.lang.IllegalArgumentException异常:clientRegistrationRepository不能为空
当我删除compile("org.springframework.boot:spring-boot-starter-web")
。有用。但我需要compile("org.springframework.boot:spring-boot-starter-web")
的招摇,Mockmvc等任何想法?
As stated in the reference documentation,加入spring-boot-starter-web
依赖于你的应用程序会告诉春季启动将其配置为一个Spring MVC应用程序。
你能得到的提示春季引导着它的一个春天WebFlux应用程序(通过qazxswpoi),但它不会在你的情况有所帮助:
SpringApplication.setWebApplicationType(WebApplicationType.REACTIVE)
代替MockMvc的