It looks like you have mixed up versions of the kafka jars:

4. kafka_2.11-0.8.3-SNAPSHOT.jar
5. kafka_2.11-0.8.2.1.jar
6. kafka-clients-0.8.2.1.jar

I think org.apache.kafka.common.utils.Utils is very new, probably post
0.8.2.1, so it's probably caused by the kafka_2.11-0.8.3-SNAPSHOT.jar being
used, and then trying to use a class which should be in the kafka-clients
jar, but since that jar is the old version kafka-clients-0.8.2.1.jar it
can't find the class.

-Ewen

On Thu, Jun 18, 2015 at 1:13 PM, Srividhya Anantharamakrishnan <
srivid...@hedviginc.com> wrote:

> Sorry for spamming, but any help would be greatly appreciated!
>
>
> On Thu, Jun 18, 2015 at 10:49 AM, Srividhya Anantharamakrishnan <
> srivid...@hedviginc.com> wrote:
>
> > The following are the jars in my classpath:
> >
> > 1. slf4j-log4j12-1.6.6.jar
> > 2. slf4j-api-1.6.6.jar
> > 3. zookeeper-3.4.6.jar
> > 4. kafka_2.11-0.8.3-SNAPSHOT.jar
> > 5. kafka_2.11-0.8.2.1.jar
> > 6. kafka-clients-0.8.2.1.jar
> > 7. metrics-core-2.2.0.jar
> > 8. scala-library-2.11.5.jar
> > 9. zkclient-0.3.jar
> >
> > Am I missing something?
> >
> > On Wed, Jun 17, 2015 at 9:15 PM, Jaikiran Pai <jai.forums2...@gmail.com>
> > wrote:
> >
> >> 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!
> >>>
> >>>
> >>
> >
>



-- 
Thanks,
Ewen

Reply via email to