kafka-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jaikiran Pai <jai.forums2...@gmail.com>
Subject Re: NoSuchMethodError with Consumer Instantiation
Date Thu, 18 Jun 2015 04:15:02 GMT
You probably have the wrong version of the Kafka jar(s) within your 
classpath. Which version of Kafka are you using and how have you setup 
the classpath?

-Jaikiran
On Thursday 18 June 2015 08:11 AM, Srividhya Anantharamakrishnan wrote:
> 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
View raw message