我使用的是spring boot 2.1.5和spring-kafka,版本未指定。项目是gradle 6.0,java 1.8
我得到了这个错误
error creating bean with name 'org.springframework.boot.autoconfigure.kafka.kafkaannotationdrivenconfiguration': unexpected exception during bean creation; nested exception is java.lang.typenotpresentexception: type org.springframework.kafka.listener.recordinterceptor not present这可能是由于什么原因?请帮帮忙。
发布于 2020-04-25 23:24:48
2.1.5已经发布将近一年了;当前的Boot 2.1.x版本是2.1.13。
2.1.5使用了spring-kafka 2.2.6,所以根据你的描述,我不明白你是如何得到这个错误的。
RecordInterceptor是在spring中添加的-kafka 2.2.7。
是added to the Spring Boot autoconfiguration in 2.2.0。
因此,您所描述的没有任何意义;您必须使用Boot2.2.x和旧的spring-kafka版本。
你有不匹配的Boot/Kafka版本。
升级到Boot 2.1.13 (或最好是2.2.6)。
https://stackoverflow.com/questions/61425823
复制相似问题