kafka-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Srividhya Anantharamakrishnan <srivid...@hedviginc.com>
Subject NoSuchMethodError with Consumer Instantiation
Date Thu, 18 Jun 2015 02:41:20 GMT
Hi,

I am trying to set up Kafka in our cluster and I am running into the
following error when Consumer is getting instantiated:

java.lang.NoSuchMethodError:
org.apache.kafka.common.utils.Utils.newThread(Ljava/lang/String;Ljava/lang/Runnable;Ljava/lang/Boolean;)Ljava/lang/Thread;

        at
kafka.utils.KafkaScheduler$$anon$1.newThread(KafkaScheduler.scala:84)

        at
java.util.concurrent.ThreadPoolExecutor$Worker.<init>(ThreadPoolExecutor.java:610)

        at
java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:924)

        at
java.util.concurrent.ThreadPoolExecutor.ensurePrestart(ThreadPoolExecutor.java:1590)

        at
java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(ScheduledThreadPoolExecutor.java:333)

        at
java.util.concurrent.ScheduledThreadPoolExecutor.scheduleAtFixedRate(ScheduledThreadPoolExecutor.java:570)

        at kafka.utils.KafkaScheduler.schedule(KafkaScheduler.scala:116)

        at
kafka.consumer.ZookeeperConsumerConnector.<init>(ZookeeperConsumerConnector.scala:136)

        at
kafka.javaapi.consumer.ZookeeperConsumerConnector.<init>(ZookeeperConsumerConnector.scala:65)

        at
kafka.javaapi.consumer.ZookeeperConsumerConnector.<init>(ZookeeperConsumerConnector.scala:68)

        at
kafka.consumer.Consumer$.createJavaConsumerConnector(ConsumerConnector.scala:120)

        at
kafka.consumer.Consumer.createJavaConsumerConnector(ConsumerConnector.scala)


I am guessing that it is missing certain classpath references. If that is
the reason, could someone tell me which jar is it?

If not, what is it that I am missing?


*KafkaConsumer:*


public KafkaConsumer(String topic)

{

* consumer = Consumer.createJavaConsumerConnector(createConsumerConfig());
//line where the error is thrown*

 this.topic = topic;

}

 private static ConsumerConfig createConsumerConfig()

{

 Properties props = new Properties();

    props.put("zookeeper.connect", "IP:PORT");

    props.put("group.id", "group1");

    props.put("zookeeper.session.timeout.ms", "6000");

    props.put("zookeeper.sync.time.ms", "2000");

    props.put("auto.commit.interval.ms", "60000");


    return new ConsumerConfig(props);

 }


TIA!

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message