我正在研究 Spring Boot JWT 示例,在此示例中 -

https://github.com/nydiarra/springboot-jwt

我只是简单地更新了 maven 依赖:

<version>1.5.3.RELEASE</version><version>1.5.13.RELEASE</version> .

我们如何修正以下错误?

org.springframework.beans.factory.BeanCreationException:在类路径资源[org / springframework / security / config / annotation / web / configuration / WebSecurityConfiguration.class]中定义名称为'springSecurityFilterChain'的bean创建错误:通过工厂方法进行Bean实例化失败;嵌套异常是org.springframework.beans.BeanInstantiationException:无法实例化[javax.servlet.Filter]:工厂方法'springSecurityFilterChain'抛出异常;嵌套异常是org.springframework.beans.factory.BeanNotOfRequiredTypeException:名为'corsFilter'的bean应该是'org.springframework.web.filter.CorsFilter'类型,但实际上是'org.springframework.boot.web.servlet'类型在org.springframework.beans的org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599)〜[spring-beans-4.3.17.RELEASE.jar:4.3.17.RELEASE]的.FilterRegistrationBean .factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1181)〜[spring-beans-4.3.17.RELEASE.jar:4.3.17.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(在Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)〜[spring]的AbstractAutowireCapableBeanFactory.java:1075)~ [spring-beans-4.3.17.RELEASE.jar:4.3.17.RELEASE] -beans-4.3 . 17.RELEASE.jar:4.3.17.RELEASE]在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)〜[spring-beans-4.3.17.RELEASE.jar:4.3.17 .RELEASE]在org.springframework的org.springframework.beans.factory.support.AbstractBeanFactory $ 1.getObject(AbstractBeanFactory.java:312)〜[spring-beans-4.3.17.RELEASE.jar:4.3.17.RELEASE] . 在org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean上的beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)〜[spring-beans-4.3.17.RELEASE.jar:4.3.17.RELEASE] (AbstractBeanFactory.java:308)〜[spring-beans-4.3.17.RELEASE.jar:4.3.17.RELEASE] org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)~ [ spring-beans-4.3.17.RELEASE.jar:4.3.17.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:297)〜[spring-beans-4.3.17.RELEASE的.jar:4.3 .17.RELEASE] org.springframework上的org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)~ [spring-beans-4.3.17.RELEASE.jar:4.3.17.RELEASE] org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization中的.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)~ [spring-beans-4.3.17.RELEASE.jar:4.3.17.RELEASE]在org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)〜[spring-context]中的AbstractApplicationContext.java:867)~ [spring-context-4.3.17.RELEASE.jar:4.3.17.RELEASE] -4.3.17.RELEASE.jar:4.3.17.RELEASE]在org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)〜[spring-boot-1.5.13.RELEASE.jar: 1.5.13.RELEASE]在org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693)[spring-boot-1.5.13.RELEASE.jar:1.5.13.RELEASE在org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360)[spring-boot-1.5.13.RELEASE.jar:1.5.13.RELEASE] org.springframework.boot.SpringApplication.run(SpringApplication . java:303)[spring-boot-1.5.13.RELEASE.jar:1.5.13.RELEASE]在org.springframework.boot.SpringApplication.run(SpringApplication.java:1118)[spring-boot-1.5.13.RELEASE .jar:1.5.13.RELEASE]在com.nouhoun的org.springframework.boot.SpringApplication.run(SpringApplication.java:1107)[spring-boot-1.5.13.RELEASE.jar:1.5.13.RELEASE] . springboot.jwt.integration.SpringbootJwtApplication.main(SpringbootJwtApplication.java:10)[classes /:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)〜[na:1.8.0_161] at sun.reflect.NativeMethodAccessorImpl.invoke (未知来源)〜[na:1.8.0_161] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)〜[na:1.8.0_161] at java.lang.reflect.Method.invoke(Unknown Source)〜[na: 1.8.0_161]在org.springframework.boot.devtools.restart.RestartL auncher.run(RestartLauncher.java:49)[spring-boot-devtools-1.5.13.RELEASE.jar:1.5.13.RELEASE]引起:org.springframework.beans.BeanInstantiationException:无法实例化[javax.servlet . 过滤]:工厂方法'springSecurityFilterChain'抛出异常;嵌套异常是org.springframework.beans.factory.BeanNotOfRequiredTypeException:名为'corsFilter'的bean应该是'org.springframework.web.filter.CorsFilter'类型,但实际上是'org.springframework.boot.web.servlet'类型在org.springframework.beans的org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189)〜[spring-beans-4.3.17.RELEASE.jar:4.3.17.RELEASE]的.FilterRegistrationBean .factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)〜[spring-beans-4.3.17.RELEASE.jar:4.3.17.RELEASE] ...省略了25个常用帧