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

SerializationException in doSend() masks class cast exception

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.11.0.0
    • Fix Version/s: 1.0.0
    • Component/s: None
    • Labels:
      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

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

                Dates

                • Created:
                  Updated:
                  Resolved: