You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Vadim Pakhnushev (Jira)" <ji...@apache.org> on 2025/09/30 12:12:00 UTC

[jira] [Updated] (IGNITE-26530) ByteArrayMarshaller.create doesn't work

     [ https://issues.apache.org/jira/browse/IGNITE-26530?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vadim Pakhnushev updated IGNITE-26530:
--------------------------------------
    Description: 
{{ByteArrayMarshaller.create}} creates an instance of the marshaller that uses the class loader of the created instance to resolve the class for creating object to unmarshal.
The class loader of {{ByteArrayMarshaller}} is an application class loader because the class matches the system classes pattern (its name starts with {{org.apache.ignite}}).
So when we try to infer the class loader to load the class to unmarshal, we use application class loader but we should use job class loader.
To reproduce this, deploy a job with a custom argument class and overridden {{inputMarshaller}} that returns {{ByteArrayMarshaller.create()}}.
Then submit this job using the {{argumentMarshaller(ByteArrayMarshaller.create())}} in the {{JobDescriptor}}.
The result is the following exception:

{noformat}
Caused by: java.lang.ClassNotFoundException: org.apache.ignite.internal.network.compatibilitytests.jobs.DeserializeJobParams
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:398)
	at java.base/java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:763)
	at org.apache.ignite.marshalling.ByteArrayMarshaller$2.resolveClass(ByteArrayMarshaller.java:84)
{noformat}


  was:
{{ByteArrayMarshaller.create}} creates an instance of the marshaller that uses the class loader of the created instance to resolve the class for creating object to unmarshal.
The class loader of {{ByteArrayMarshaller}} is an application class loader because the class matches the system classes pattern (its name starts with {{org.apache.ignite}}).
So when we try to infer the class loader to load the class to unmarshal, we use application class loader but we should use job class loader.
To reproduce this, deploy a job with a custom argument class and overridden {{inputMarshaller}} that returns {{ByteArrayMarshaller.create()}}.
Then submit this job using the {{argumentMarshaller(ByteArrayMarshaller.create())}} in the {{JobDecriptor}}.
The result is the following exception:

{noformat}
Caused by: java.lang.ClassNotFoundException: org.apache.ignite.internal.network.compatibilitytests.jobs.DeserializeJobParams
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:398)
	at java.base/java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:763)
	at org.apache.ignite.marshalling.ByteArrayMarshaller$2.resolveClass(ByteArrayMarshaller.java:84)
{noformat}



> ByteArrayMarshaller.create doesn't work
> ---------------------------------------
>
>                 Key: IGNITE-26530
>                 URL: https://issues.apache.org/jira/browse/IGNITE-26530
>             Project: Ignite
>          Issue Type: Bug
>          Components: compute ai3
>            Reporter: Vadim Pakhnushev
>            Assignee: Vadim Pakhnushev
>            Priority: Major
>              Labels: ignite-3
>
> {{ByteArrayMarshaller.create}} creates an instance of the marshaller that uses the class loader of the created instance to resolve the class for creating object to unmarshal.
> The class loader of {{ByteArrayMarshaller}} is an application class loader because the class matches the system classes pattern (its name starts with {{org.apache.ignite}}).
> So when we try to infer the class loader to load the class to unmarshal, we use application class loader but we should use job class loader.
> To reproduce this, deploy a job with a custom argument class and overridden {{inputMarshaller}} that returns {{ByteArrayMarshaller.create()}}.
> Then submit this job using the {{argumentMarshaller(ByteArrayMarshaller.create())}} in the {{JobDescriptor}}.
> The result is the following exception:
> {noformat}
> Caused by: java.lang.ClassNotFoundException: org.apache.ignite.internal.network.compatibilitytests.jobs.DeserializeJobParams
> 	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
> 	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
> 	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
> 	at java.base/java.lang.Class.forName0(Native Method)
> 	at java.base/java.lang.Class.forName(Class.java:398)
> 	at java.base/java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:763)
> 	at org.apache.ignite.marshalling.ByteArrayMarshaller$2.resolveClass(ByteArrayMarshaller.java:84)
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)