[
https://issues.apache.org/jira/browse/IGNITE-26181?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18013196#comment-18013196
]
Mikhail Pochatkin commented on IGNITE-26181:
--------------------------------------------
The root cause of this problem that
org.apache.ignite.marshalling.JavaSerializationByteArrayMarshalling always
loading from Application Class loader but user defined POJO only accesable from
Compute job class loader
> Byte array marshalling is not wokring
> --------------------------------------
>
> Key: IGNITE-26181
> URL: https://issues.apache.org/jira/browse/IGNITE-26181
> Project: Ignite
> Issue Type: Bug
> Components: code deployment ai3, compute ai3
> Reporter: Mikhail Pochatkin
> Assignee: Mikhail Pochatkin
> Priority: Major
> Labels: ignite-3
>
> h2. Context
> In case of {{ByteArrayMarshaller}} usage as an {{argumentMarshaller}} for the
> compute job, the POJO argument can’t be deserialized due to
> {{{}ClassNotFoundException{}}}:
>
> {code:java}
> {{2025-07-07 20:49:32:291 -0700
> [WARNING][%defaultNode%compute-1][ClientInboundMessageHandler] Error
> processing client notification [connectionId=2, id=2,
> remoteAddress=/127.0.0.1:60318]:org.apache.ignite.compute.ComputeException:
> IGN-COMPUTE-13 Exception in user-defined marshaller
> TraceId:71e9c2cbjava.util.concurrent.CompletionException:
> org.apache.ignite.compute.ComputeException: IGN-COMPUTE-13 Exception in
> user-defined marshaller TraceId:71e9c2cb
> at
> org.apache.ignite.internal.compute.ComputeUtils.lambda$convertToComputeFuture$1(ComputeUtils.java:339)
> at
> java.base/java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:930)
> at
> java.base/java.util.concurrent.CompletableFuture$UniHandle.tryFire(CompletableFuture.java:907)
> at
> java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
> at
> java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2094)
> at
> org.apache.ignite.internal.compute.queue.QueueExecutionImpl.lambda$run$1(QueueExecutionImpl.java:189)
> at
> java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:859)
> at
> java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:837)
> at
> java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
> at
> java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2094)
> at org.apache.ignite.internal.compute.queue.QueueEntry.run(QueueEntry.java:82)
> at
> java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
> at
> java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
> at java.base/java.lang.Thread.run(Thread.java:829)
> Caused by: org.apache.ignite.compute.ComputeException: IGN-COMPUTE-13
> Exception in user-defined marshaller TraceId:71e9c2cb
> at
> org.apache.ignite.internal.compute.SharedComputeUtils.unmarshalArgOrResult(SharedComputeUtils.java:173)
> at
> org.apache.ignite.internal.compute.ComputeUtils.unmarshalOrNotIfNull(ComputeUtils.java:377)
> at
> org.apache.ignite.internal.compute.executor.ComputeExecutorImpl.lambda$unmarshalExecMarshal$1(ComputeExecutorImpl.java:194)
> at
> org.gridgain.internal.security.context.SecuredCallable.call(SecuredCallable.java:35)
> at
> org.apache.ignite.internal.compute.queue.QueueExecutionImpl.lambda$run$0(QueueExecutionImpl.java:160)
> at org.apache.ignite.internal.compute.queue.QueueEntry.run(QueueEntry.java:73)
> ... 3 more
> Caused by: org.apache.ignite.marshalling.MarshallingException:
> IGN-MARSHALLING-1
> org.apache.ignite.example.ComputeWithCustomMarshallerExample$PojoArgs
> TraceId:71e9c2cb
> at
> org.apache.ignite.marshalling.JavaSerializationByteArrayMarshalling.unmarshal(JavaSerializationByteArrayMarshalling.java:59)
> at
> org.apache.ignite.marshalling.ByteArrayMarshaller.unmarshal(ByteArrayMarshaller.java:46)
> at
> org.apache.ignite.marshalling.ByteArrayMarshaller.unmarshal(ByteArrayMarshaller.java:21)
> at
> org.apache.ignite.internal.compute.SharedComputeUtils.unmarshalArgOrResult(SharedComputeUtils.java:171)
> ... 8 more
> Caused by: java.lang.ClassNotFoundException:
> org.apache.ignite.example.ComputeWithCustomMarshallerExample$PojoArgs
> 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:527)
> 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:752)
> at
> java.base/java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:2003)
> at
> java.base/java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1870)
> at
> java.base/java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2201)
> at
> java.base/java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1687)
> at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:489)
> at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:447)
> at
> org.apache.ignite.marshalling.JavaSerializationByteArrayMarshalling.unmarshal(JavaSerializationByteArrayMarshalling.java:57)
> ... 11 more}} {code}
>
> Steps to reproduce:
> # Add the attached {{ComputeWithCustomMarshallerExample}} class to the
> {{org.apache.ignite.example}} package of {{ignite-examples}} project
> # Build a JAR using the next command: {{./gradlew :ignite-examples:jar}}
> # Start and initialize a new cluster in a dedicated JVM without
> {{ComputeWithCustomMarshallerExample}} class in the classpath. (ignite3db
> using binary distribution)
> # Deploy a deployment unit with a JAR build in step 2:
>
> {code:java}
> cluster unit deploy computeExampleUnit --version 1.0.0
> --path=.../ignite-3/examples/build/libs/ignite-examples-3.1.0.jar {code}
> Run {{ComputeWithCustomMarshallerExample}} example. As a result, the job
> execution fails with an argument deserialization error on the server side.
> (see exception above)
--
This message was sent by Atlassian Jira
(v8.20.10#820010)