Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-5620

SerializationException in doSend() masks class cast exception

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.11.0.0
    • 1.0.0
    • None
    • None

    Description

      I misconfigured my Serializer and passed a byte array to BytesSerializer. This caused the following exception to be thrown.

      org.apache.kafka.common.errors.SerializationException: Can't convert value of class [B to class org.apache.kafka.common.serialization.BytesSerializer specified in value.serializer
      

      This doesn't provide much detail because it strips the ClassCastException. It made figuring this out much more difficult. The real value was the inner exception which was:

      [B cannot be cast to org.apache.kafka.common.utils.Bytes
      

      We should include the ClassCastException.

      Attachments

        Issue Links

          Activity

            People

              jcustenborder Jeremy Custenborder
              jcustenborder Jeremy Custenborder
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: