You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/07/20 16:50:00 UTC

[jira] [Commented] (KAFKA-5620) SerializationException in doSend() masks class cast exception

    [ https://issues.apache.org/jira/browse/KAFKA-5620?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16094953#comment-16094953 ] 

ASF GitHub Bot commented on KAFKA-5620:
---------------------------------------

GitHub user jcustenborder opened a pull request:

    https://github.com/apache/kafka/pull/3556

    KAFKA-5620

    Expose the ClassCastException as the cause for the SerializationException.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jcustenborder/kafka KAFKA-5620

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/kafka/pull/3556.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #3556
    
----
commit 42af71d407e39c1ef4d13fecab05ed59a9c8354f
Author: Jeremy Custenborder <jc...@gmail.com>
Date:   2017-07-20T16:48:00Z

    KAFKA-5620 - Expose the ClassCastException as the cause for the SerializationException.

----


> SerializationException in doSend() masks class cast exception
> -------------------------------------------------------------
>
>                 Key: KAFKA-5620
>                 URL: https://issues.apache.org/jira/browse/KAFKA-5620
>             Project: Kafka
>          Issue Type: Bug
>    Affects Versions: 0.11.0.0
>            Reporter: Jeremy Custenborder
>            Assignee: Jeremy Custenborder
>
> I misconfigured my Serializer and passed a byte array to BytesSerializer. This caused the following exception to be thrown. 
> {code}
> 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
> {code}
> 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:
> {code}
> [B cannot be cast to org.apache.kafka.common.utils.Bytes
> {code}
> We should include the ClassCastException.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)