org.springframework.beans.factory.annotation.annotatedbeandefinition.setrole(i)v
在配置类中设置@enablekafka时发生了这种情况
maven依赖项:
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>5.0.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>5.0.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>5.1.4.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>5.1.4.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.kafka</groupId>
<artifactId>spring-kafka</artifactId>
<version>2.2.3.RELEASE</version>
</dependency>
谢谢
1条答案
按热度按时间htzpubme1#
这是Spring模块版本不匹配。
根据javadoc
BeanDefinition#setRole
方法存在于5.1
.所以检查你的
org.springframework.spring-beans
附属国。Spring Kafka 2.2.3.RELEASE
需要Spring5.1.4
既然你更新了你的问题,升级你的spring-webmvc
以及spring-security-config
```spring-webmvc 5.1.4.RELEASE
spring-security-config 5.1.3.RELEASE