[
https://issues.apache.org/jira/browse/CAMEL-27259?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Claus Ibsen reassigned CAMEL-27259:
-----------------------------------
Fix Version/s: 4.24.0
Assignee: Claus Ibsen
> camel-mongodb - insert of a byte[] body fails with ClassCastException
> ---------------------------------------------------------------------
>
> Key: CAMEL-27259
> URL: https://issues.apache.org/jira/browse/CAMEL-27259
> Project: Camel
> Issue Type: Bug
> Components: camel-mongodb
> Reporter: Claus Ibsen
> Assignee: Claus Ibsen
> Priority: Major
> Fix For: 4.24.0
>
>
> {{MongoDbProducer}} (insert) checks {{insert.getClass().isArray()}} and casts
> the body to {{Object[]}}. A {{byte[]}} body, such as JSON text from a Kafka
> consumer or a source with the {{binary}} data type, is an array but not an
> {{Object[]}}, so the insert fails: {{ClassCastException: class [B cannot be
> cast to class [Ljava.lang.Object;}}.
> Expected: a {{byte[]}} body is converted like a String, as JSON text to a
> Document. Only an {{Object[]}} (or a List) is a batch insert.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)