Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Kafka >> mail # user >> java.lang.NoClassDefFoundError: scala/reflect/ClassManifest


Copy link to this message
-
Re: java.lang.NoClassDefFoundError: scala/reflect/ClassManifest
Turns out that I forgot to change my POM to use 2.10 version, this fixes
it in case someone else is trying to do the same thing
<dependency>
 <groupId>org.apache.kafka</groupId>
 <artifactId>kafka_2.10</artifactId>
 <version>0.8.0</version>
        </dependency>
Bob

On 10/31/13, 10:53 AM, "Ngu, Bob" <[EMAIL PROTECTED]> wrote:

>I built and deployed latest 0.8 version on Scala 2.10.2 to my local maven
>repository.  I also started a sample producer API app using Scala 2.10.2,
>building the app causes java.lang.NoClassDefFoundError error when calling
>ProducerConfig, see below for code.
>
>package com.foo.bar
>package common
>
>import kafka.javaapi.producer.Producer
>import kafka.producer.KeyedMessage
>import kafka.producer.ProducerConfig
>
>import java.util.Properties
>
>class KafkaProducer {
>  // create a producer
>
>  val props = new Properties()
>
>  props.put("metadata.broker.list", "broker0:9092")
>  props.put("serializer.class", "kafka.serializer.StringEncoder")
>  props.put("request.required.acks", "1")
>
>  val config = new ProducerConfig(props)
>
>  val producer = new Producer[String, String](config)
>
>  //sending...
>  val topic = "test"
>  val message = "_Message_1"
>  val keyedMessage = new KeyedMessage[String, String](topic, message)
>  producer.send(keyedMessage)
>
>}
>
>Any help is much appreciated.
>
>Thanks,
>Bob