title: Error creating bean with name 'kafkaListenerContainerFactory
body: <p>I am new to kafka, springboot and trying to integrate kafka and elastic search in my springboot application.</p>
  
  <p>When I try to run the springboot app I see below error:</p>
  
  <pre><code>org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'kafkaListenerContainerFactory' defined in class path resource [org/springframework/boot/autoconfigure/kafka/KafkaAnnotationDrivenConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.kafka.config.ConcurrentKafkaListenerContainerFactory]: Factory method 'kafkaListenerContainerFactory' threw exception; nested exception is java.lang.NoSuchMethodError:org.springframework.kafka.config.ConcurrentKafkaListenerContainerFactory.getContainerProperties()Lorg/springframework/kafka/listener/config/ContainerProperties;
  </code></pre>
  
  <p>My pom.xml</p>
  
  <pre><code> &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.kafka&lt;/groupId&gt;
              &lt;artifactId&gt;spring-kafka&lt;/artifactId&gt;
              &lt;version&gt;2.2.3.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-data-jpa&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-data-elasticsearch&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;net.java.dev.jna&lt;/groupId&gt;
              &lt;artifactId&gt;jna&lt;/artifactId&gt;
              &lt;version&gt;4.1.0&lt;/version&gt;
          &lt;/dependency&gt;
  </code></pre>
  
  <p>Application.yml</p>
  
  <pre><code>  security:
      enabled: true
  
  spring:
    resources:
      chain:
        enabled: true
  
  kafka:
    consumer:
      bootstrap-servers: localhost:9092
      group-id: group-id
      auto-offset-reset: earliest
      key-deserializer: org.apache.kafka.common.serialization.StringDeserializer
      value-deserializer: org.apache.kafka.common.serialization.StringDeserializer
    producer:
      bootstrap-servers: localhost:9092
      key-serializer: org.apache.kafka.common.serialization.StringSerializer
      value-serializer: org.apache.kafka.common.serialization.StringDeserializer
  
  
  </code></pre>
  
  <p>Producer class</p>
  
  <pre><code>
  @Service
  public class Producer {
      private static final Logger logger = LoggerFactory.getLogger(Producer.class);
      private static  final  String topic = "users";
  
      @Autowired
      private KafkaTemplate&lt;String, String&gt; kafkaTemplate;
  
      public void sendMessage(History t){
          logger.info("Inside send message to topic");
          this.kafkaTemplate.send(topic,"HelloWorld");
      }
  
  }
  </code></pre>
  
  <p>Consumer.java</p>
  
  <pre><code>package com.springboot.kafka;
  
  import com.springboot.model.History;
  import com.springboot.repository.HistoryRepository;
  import org.apache.kafka.common.protocol.types.Field;
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  import org.springframework.kafka.annotation.KafkaListener;
  import org.springframework.stereotype.Service;
  
  @Service
  public class Consumer  {
      private static final Logger logger = LoggerFactory.getLogger(Consumer.class);
      private static  final  String topic = "users";
  
  
      @KafkaListener(topics = topic,groupId = "group-id")
      public void consume (String t){
          logger.info("Message read as " + t);
  
      }
  }
  </code></pre>
  
  <p>Application.properties:</p>
  
  <pre><code>logging.level.sql=info
  logging.file = /var/tmp/SpringBootAppLog.log
  spring.datasource.driver=org.postgresql.Driver
  spring.datasource.url=jdbc:postgresql://localhost:5432/test
  spring.datasource.username=postgres
  spring.datasource.password=postgres
  
  spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
  spring.jpa.properties.hibernate.show_sql=true
  spring.jpa.hibernate.ddl-auto=update
  spring.data.elasticsearch.cluster-name=my-application
  spring.data.elasticsearch.cluster-nodes=localhost:9200
  </code></pre>
  
  <p>Any idea on what I am missing on. Any leads will be highly appreciated.</p>