[
https://issues.apache.org/jira/browse/IGNITE-22393?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Tiago Marques Godinho updated IGNITE-22393:
-------------------------------------------
Description:
I'm using the Mapper API with a TypeConverter to convert a POJO field into and
Instant/Timestamp column.
However, the FieldAccessor code is very strict. It tries to find the binary
mode directly from the original field type (in the POJO) instead of the target
type of my TypeConverter.
[Here is the
culpit|https://github.com/apache/ignite-3/blob/ceac03f6b8574c1cbe23aed64ce082a6a4978ea1/modules/marshaller-common/src/main/java/org/apache/ignite/internal/marshaller/FieldAccessor.java#L73-L79]
Stacktrace:
{code:java}
Caused by: org.apache.ignite.lang.IgniteException: IGN-CMN-65535
TraceId:c3ef0478-fd84-4d47-a33b-2a19a1f67e59 java.lang.ClassCastException:
class java.time.LocalDate cannot be cast to class [B (java.time.LocalDate and
[B are in module java.base of loader 'bootstrap')
at
app//org.apache.ignite.internal.client.table.ClientKeyValueView.writeKeyValueRaw(ClientKeyValueView.java:610)
at
app//org.apache.ignite.internal.client.table.ClientKeyValueView.writeKeyValue(ClientKeyValueView.java:590)
at
app//org.apache.ignite.internal.client.table.ClientKeyValueView.lambda$putAsync$9(ClientKeyValueView.java:235)
at
app//org.apache.ignite.internal.client.table.ClientTable.lambda$doSchemaOutInOpAsync$5(ClientTable.java:460)
at
app//org.apache.ignite.internal.client.TcpClientChannel.send(TcpClientChannel.java:332)
... 30 more
Caused by: org.apache.ignite.internal.marshaller.MarshallerException:
IGN-CMN-65535 TraceId:c3ef0478-fd84-4d47-a33b-2a19a1f67e59
java.lang.ClassCastException: class java.time.LocalDate cannot be cast to class
[B (java.time.LocalDate and [B are in module java.base of loader 'bootstrap')
at
app//org.apache.ignite.internal.marshaller.FieldAccessor.write(FieldAccessor.java:401)
at
app//org.apache.ignite.internal.marshaller.Marshaller$PojoMarshaller.writeField(Marshaller.java:300)
at
app//org.apache.ignite.internal.client.table.ClientKeyValueView.writeKeyValueRaw(ClientKeyValueView.java:606)
... 34 more
Caused by: java.lang.IllegalArgumentException: java.lang.ClassCastException:
class java.time.LocalDate cannot be cast to class [B (java.time.LocalDate and
[B are in module java.base of loader 'bootstrap')
at
org.apache.ignite.internal.marshaller.FieldAccessor$ReferenceFieldAccessor.write0(FieldAccessor.java:809)
at
org.apache.ignite.internal.marshaller.FieldAccessor.write(FieldAccessor.java:399)
... 36 more
Caused by: java.lang.ClassCastException: class java.time.LocalDate cannot be
cast to class [B (java.time.LocalDate and [B are in module java.base of loader
'bootstrap')
at
org.apache.ignite.internal.marshaller.FieldAccessor.writeRefObject(FieldAccessor.java:381)
at
org.apache.ignite.internal.marshaller.FieldAccessor$ReferenceFieldAccessor.write0(FieldAccessor.java:807)
... 37 more {code}
was:
I'm using the Mapper API with a TypeConverter to convert a POJO field into and
Instant/Timestamp column.
However, the FieldAccessor code is very strict. It tries to find the binary
mode directly from the original field type (in the POJO) instead of the target
type of my TypeConverter.
[Here is the
culpit|https://github.com/apache/ignite-3/blob/ceac03f6b8574c1cbe23aed64ce082a6a4978ea1/modules/marshaller-common/src/main/java/org/apache/ignite/internal/marshaller/FieldAccessor.java#L73-L79]
> FieldAccessor does not set the correct BinaryMode when a TypeConverter is
> used to Map a POJO field
> --------------------------------------------------------------------------------------------------
>
> Key: IGNITE-22393
> URL: https://issues.apache.org/jira/browse/IGNITE-22393
> Project: Ignite
> Issue Type: Bug
> Affects Versions: 3.0.0-beta1
> Reporter: Tiago Marques Godinho
> Priority: Major
> Labels: ignite-3
>
> I'm using the Mapper API with a TypeConverter to convert a POJO field into
> and Instant/Timestamp column.
> However, the FieldAccessor code is very strict. It tries to find the binary
> mode directly from the original field type (in the POJO) instead of the
> target type of my TypeConverter.
> [Here is the
> culpit|https://github.com/apache/ignite-3/blob/ceac03f6b8574c1cbe23aed64ce082a6a4978ea1/modules/marshaller-common/src/main/java/org/apache/ignite/internal/marshaller/FieldAccessor.java#L73-L79]
> Stacktrace:
> {code:java}
> Caused by: org.apache.ignite.lang.IgniteException: IGN-CMN-65535
> TraceId:c3ef0478-fd84-4d47-a33b-2a19a1f67e59 java.lang.ClassCastException:
> class java.time.LocalDate cannot be cast to class [B (java.time.LocalDate and
> [B are in module java.base of loader 'bootstrap')
> at
> app//org.apache.ignite.internal.client.table.ClientKeyValueView.writeKeyValueRaw(ClientKeyValueView.java:610)
> at
> app//org.apache.ignite.internal.client.table.ClientKeyValueView.writeKeyValue(ClientKeyValueView.java:590)
> at
> app//org.apache.ignite.internal.client.table.ClientKeyValueView.lambda$putAsync$9(ClientKeyValueView.java:235)
> at
> app//org.apache.ignite.internal.client.table.ClientTable.lambda$doSchemaOutInOpAsync$5(ClientTable.java:460)
> at
> app//org.apache.ignite.internal.client.TcpClientChannel.send(TcpClientChannel.java:332)
> ... 30 more
> Caused by: org.apache.ignite.internal.marshaller.MarshallerException:
> IGN-CMN-65535 TraceId:c3ef0478-fd84-4d47-a33b-2a19a1f67e59
> java.lang.ClassCastException: class java.time.LocalDate cannot be cast to
> class [B (java.time.LocalDate and [B are in module java.base of loader
> 'bootstrap')
> at
> app//org.apache.ignite.internal.marshaller.FieldAccessor.write(FieldAccessor.java:401)
> at
> app//org.apache.ignite.internal.marshaller.Marshaller$PojoMarshaller.writeField(Marshaller.java:300)
> at
> app//org.apache.ignite.internal.client.table.ClientKeyValueView.writeKeyValueRaw(ClientKeyValueView.java:606)
> ... 34 more
> Caused by: java.lang.IllegalArgumentException: java.lang.ClassCastException:
> class java.time.LocalDate cannot be cast to class [B (java.time.LocalDate and
> [B are in module java.base of loader 'bootstrap')
> at
> org.apache.ignite.internal.marshaller.FieldAccessor$ReferenceFieldAccessor.write0(FieldAccessor.java:809)
> at
> org.apache.ignite.internal.marshaller.FieldAccessor.write(FieldAccessor.java:399)
> ... 36 more
> Caused by: java.lang.ClassCastException: class java.time.LocalDate cannot be
> cast to class [B (java.time.LocalDate and [B are in module java.base of
> loader 'bootstrap')
> at
> org.apache.ignite.internal.marshaller.FieldAccessor.writeRefObject(FieldAccessor.java:381)
> at
> org.apache.ignite.internal.marshaller.FieldAccessor$ReferenceFieldAccessor.write0(FieldAccessor.java:807)
> ... 37 more {code}
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)