java.lang.NoSuchMethodError on Kafka Consumer with spring-kafka 2.1.0 and SpringBoot 1.5.9

前端 未结 1 1358
孤街浪徒
孤街浪徒 2021-02-04 07:41

I am trying to setup Kafka Consumer using SpringBoot(1.5.9) and Spring-kafka(2.1.0). However when I start my app I get java.lang.NoSuchMethodError: org.springframework.util.Asse

1条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-04 08:19

    The Spring-kafka 2.1 is based on the Spring Framework 5.0 and that is exactly what you see with that error:

    java.lang.NoSuchMethodError: org.springframework.util.Assert.state(ZLjava/util/function/Supplier;)
    

    Spring Framework 4.3 (the foundation for Spring Boot 1.5) doesn't support Java 8 yet.

    You should consider to switch to Spring Boot 2.0 or stick with the Spring Kafka 1.3.2 which is compatible with Boot 1.5 background and can be reconfigured for Apache Kafka 1.0 Client.

    0 讨论(0)
提交回复
热议问题