java.lang.ClassCastException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • Working of git master codebase and following instructions at https://github.com/apache/kafka/blob/trunk/contrib/hadoop-consumer/README https://github.com/apache/kafka when running ./run-class.sh kafka.etl.impl.DataGenerator test/test.properties an exception is thrown Exception in thread "main" java.lang.ClassCastException: kafka.message.Message cannot be cast to [B at kafka.serializer.DefaultEncoder.toBytes(Encoder.scala:34) at kafka.producer.async.DefaultEventHandler$$anonfun$serialize$1.apply(DefaultEventHandler.scala:129) at kafka.producer.async.DefaultEventHandler$$anonfun$serialize$1.apply(DefaultEventHandler.scala:124) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:233) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:233) at scala.collection.Iterator$class.foreach(Iterator.scala:772) at scala.collection.JavaConversions$JIteratorWrapper.foreach(JavaConversions.scala:573) at scala.collection.IterableLike$class.foreach(IterableLike.scala:73) at scala.collection.JavaConversions$JListWrapper.foreach(JavaConversions.scala:615) at scala.collection.TraversableLike$class.map(TraversableLike.scala:233) at scala.collection.JavaConversions$JListWrapper.map(JavaConversions.scala:615) at kafka.producer.async.DefaultEventHandler.serialize(DefaultEventHandler.scala:124) at kafka.producer.async.DefaultEventHandler.handle(DefaultEventHandler.scala:54) at kafka.producer.Producer.send(Producer.scala:74) at kafka.javaapi.producer.Producer.send(Producer.scala:41)
    via by Andrew Milkowski,
  • Camel Kafka Integration
    via by Unknown author,
    • java.lang.ClassCastException: kafka.message.Message cannot be cast to [B at kafka.serializer.DefaultEncoder.toBytes(Encoder.scala:34) at kafka.producer.async.DefaultEventHandler$$anonfun$serialize$1.apply(DefaultEventHandler.scala:129) at kafka.producer.async.DefaultEventHandler$$anonfun$serialize$1.apply(DefaultEventHandler.scala:124) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:233) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:233) at scala.collection.Iterator$class.foreach(Iterator.scala:772) at scala.collection.JavaConversions$JIteratorWrapper.foreach(JavaConversions.scala:573) at scala.collection.IterableLike$class.foreach(IterableLike.scala:73) at scala.collection.JavaConversions$JListWrapper.foreach(JavaConversions.scala:615) at scala.collection.TraversableLike$class.map(TraversableLike.scala:233) at scala.collection.JavaConversions$JListWrapper.map(JavaConversions.scala:615) at kafka.producer.async.DefaultEventHandler.serialize(DefaultEventHandler.scala:124) at kafka.producer.async.DefaultEventHandler.handle(DefaultEventHandler.scala:54) at kafka.producer.Producer.send(Producer.scala:74) at kafka.javaapi.producer.Producer.send(Producer.scala:41)

    Users with the same issue

    Unknown visitor1 times, last one,