You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Taras Ledkov (Jira)" <ji...@apache.org> on 2021/12/01 15:26:00 UTC

[jira] [Comment Edited] (IGNITE-16028) Node failure with ClassNotFoundException: wrong validation for Object type

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

Taras Ledkov edited comment on IGNITE-16028 at 12/1/21, 3:25 PM:
-----------------------------------------------------------------

{quote}Why do we want to declare query field as object in the first place?{quote}
[~nizhikov], please take a look at the reproducer. What type name would you recommend to the user for the case from the reproducer?
Also, for the case when the field may contain two different types of BinObj?

My point: we have to skip check the type inheritance when the type is user-created binary type.
{{BinaryObject}} and the ability to use it instead of the read user classes is a public API of the Ignite. So we have to support it.


was (Author: tledkov-gridgain):
{quote}Why do we want to declare query field as object in the first place?{quote}
[~nizhikov], please take a look at the reproducer. What type name would you recommend to the user for the case from the reproducer?
Also, for the case when the field may contain two different types of BinObj?

My point: we have to skip check the type inheritance when the type is user-created binary type.

> Node failure with ClassNotFoundException: wrong validation for Object type
> --------------------------------------------------------------------------
>
>                 Key: IGNITE-16028
>                 URL: https://issues.apache.org/jira/browse/IGNITE-16028
>             Project: Ignite
>          Issue Type: Bug
>          Components: sql
>            Reporter: Vladimir Ermakov
>            Assignee: Vladimir Ermakov
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> After implementing the fix for IGNITE-13553, we have an issue that Object type can't be used for any other type except the Object one.
>  
> The cache object type can be declared as java.lang.Object. For example,
> {code:java}
> .addQueryField("val_obj", Object.class.getName(), null){code}
> But, we can use BinaryObjectBuilder to build BinaryObject and put it as 'val_obj'.
> For example, 
> {code:java}
> BinaryObjectBuilder bobInner = grid().binary().builder("inner");
> ///
> bob.setField("val_obj", bobInner.build());{code}
> So, we will have an object with 'inner' class name. But a class with that name never existed.
> During type validation (introduced in IGNITE-13553) the binaryObject's typeId and the java.lang.Object typeId will not match. Then we will try to get the class of the object by 'inner' class name, and will definitely face with ClassNotFoundException.
> QueryTypeDescriptorImpl#730 line of code.
>  
> Please, see BasicIndexTest#testCacheSecondaryCompositeIndex reproducer for more details.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)