java.lang.ClassCastException: kafka.message.Message cannot be cast to [B

Apache's JIRA Issue Tracker | Andrew Milkowski | 4 years ago
  1. 0

    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)

    Apache's JIRA Issue Tracker | 4 years ago | Andrew Milkowski
    java.lang.ClassCastException: kafka.message.Message cannot be cast to [B
  2. 0

    Sending data from kafka producer in spark using scala

    Stack Overflow | 2 years ago | user3823859
    java.lang.ClassCastException: org.jnetpcap.packet.PcapPacket cannot be cast to java.lang.String
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Building camus with different hadoop versions

    Google Groups | 4 years ago | Unknown author
    java.io.IOException: java.lang.ClassCastException: kafka.message.Message cannot be cast to [B
  5. 0

    Building camus with different hadoop versions

    Google Groups | 4 years ago | Unknown author
    java.io.IOException: java.lang.ClassCastException: kafka.message.Message cannot be cast to [B

    1 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.ClassCastException

      kafka.message.Message cannot be cast to [B

      at kafka.serializer.DefaultEncoder.toBytes()
    2. Apache Kafka
      DefaultEventHandler$$anonfun$serialize$1.apply
      1. kafka.serializer.DefaultEncoder.toBytes(Encoder.scala:34)
      2. kafka.producer.async.DefaultEventHandler$$anonfun$serialize$1.apply(DefaultEventHandler.scala:129)
      3. kafka.producer.async.DefaultEventHandler$$anonfun$serialize$1.apply(DefaultEventHandler.scala:124)
      3 frames
    3. Scala
      JavaConversions$JListWrapper.map
      1. scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:233)
      2. scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:233)
      3. scala.collection.Iterator$class.foreach(Iterator.scala:772)
      4. scala.collection.JavaConversions$JIteratorWrapper.foreach(JavaConversions.scala:573)
      5. scala.collection.IterableLike$class.foreach(IterableLike.scala:73)
      6. scala.collection.JavaConversions$JListWrapper.foreach(JavaConversions.scala:615)
      7. scala.collection.TraversableLike$class.map(TraversableLike.scala:233)
      8. scala.collection.JavaConversions$JListWrapper.map(JavaConversions.scala:615)
      8 frames
    4. Apache Kafka
      Producer.send
      1. kafka.producer.async.DefaultEventHandler.serialize(DefaultEventHandler.scala:124)
      2. kafka.producer.async.DefaultEventHandler.handle(DefaultEventHandler.scala:54)
      3. kafka.producer.Producer.send(Producer.scala:74)
      4. kafka.javaapi.producer.Producer.send(Producer.scala:41)
      4 frames