I am working with Apache Ignite (version 2.17.0) and have a setup where I create ad-hoc caches from the client-side with peer class loading enabled. Additionally, I have a server-side node running in server mode.
My requirement is to execute a compute task from the client-side that extends SplitComputeTaskAdapter
to run scan queries on the cache. However, when executing the compute task, I am encountering the following error:
Error Log
Caused by: java.lang.ClassNotFoundException: com.ignite.proxy.spring.jpa.pojo.Abc
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581) ~[na:na]
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) ~[na:na]
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526) ~[na:na]
at java.base/java.lang.Class.forName0(Native Method) ~[na:na]
at java.base/java.lang.Class.forName(Class.java:398) ~[na:na]
at .apache.ignite.internal.util.IgniteUtils.forName(IgniteUtils.java:9348) ~[ignite-core-2.17.0.jar:2.17.0]
at .apache.ignite.internal.util.IgniteUtils.forName(IgniteUtils.java:9286) ~[ignite-core-2.17.0.jar:2.17.0]
at .apache.ignite.internal.MarshallerContextImpl.getClass(MarshallerContextImpl.java:397) ~[ignite-core-2.17.0.jar:2.17.0]
at .apache.ignite.internal.binary.BinaryContext.descriptorForTypeId(BinaryContext.java:717) ~[ignite-core-2.17.0.jar:2.17.0]
... 28 common frames omitted
My Configuration Peer-Class Loading:
peerClassLoadingEnabled = true
is set on both the client-side and server-side.
Binary Configuration (Server-Side):
BinaryConfiguration binCfg = new BinaryConfiguration();
binCfg.setNameMapper(new BinaryBasicNameMapper().setSimpleName(true));
binCfg.setIdMapper(new BinaryBasicIdMapper());
Binary Configuration (Client-Side):
BinaryConfiguration binCfg = new BinaryConfiguration();
binCfg.setNameMapper(new BinaryBasicNameMapper().setSimpleName(true));
binCfg.setIdMapper(new BinaryBasicIdMapper());
What I've Tried:
- Verified that peer-class loading is enabled on both client and Server.
- Ensured that the compute task is deployed on the client-side.
- Checked if the class exists in the client project and is accessible.
- Confirmed that binary marshalling configuration is consistent between the server and client.
Question:
Why am I encountering ClassNotFoundException
even though peer-class loading is enabled? How can I ensure that the compute task and related classes are properly loaded when executing the task on the server?
Any insights or solutions would be greatly appreciated. Thanks!
I am working with Apache Ignite (version 2.17.0) and have a setup where I create ad-hoc caches from the client-side with peer class loading enabled. Additionally, I have a server-side node running in server mode.
My requirement is to execute a compute task from the client-side that extends SplitComputeTaskAdapter
to run scan queries on the cache. However, when executing the compute task, I am encountering the following error:
Error Log
Caused by: java.lang.ClassNotFoundException: com.ignite.proxy.spring.jpa.pojo.Abc
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581) ~[na:na]
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) ~[na:na]
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526) ~[na:na]
at java.base/java.lang.Class.forName0(Native Method) ~[na:na]
at java.base/java.lang.Class.forName(Class.java:398) ~[na:na]
at .apache.ignite.internal.util.IgniteUtils.forName(IgniteUtils.java:9348) ~[ignite-core-2.17.0.jar:2.17.0]
at .apache.ignite.internal.util.IgniteUtils.forName(IgniteUtils.java:9286) ~[ignite-core-2.17.0.jar:2.17.0]
at .apache.ignite.internal.MarshallerContextImpl.getClass(MarshallerContextImpl.java:397) ~[ignite-core-2.17.0.jar:2.17.0]
at .apache.ignite.internal.binary.BinaryContext.descriptorForTypeId(BinaryContext.java:717) ~[ignite-core-2.17.0.jar:2.17.0]
... 28 common frames omitted
My Configuration Peer-Class Loading:
peerClassLoadingEnabled = true
is set on both the client-side and server-side.
Binary Configuration (Server-Side):
BinaryConfiguration binCfg = new BinaryConfiguration();
binCfg.setNameMapper(new BinaryBasicNameMapper().setSimpleName(true));
binCfg.setIdMapper(new BinaryBasicIdMapper());
Binary Configuration (Client-Side):
BinaryConfiguration binCfg = new BinaryConfiguration();
binCfg.setNameMapper(new BinaryBasicNameMapper().setSimpleName(true));
binCfg.setIdMapper(new BinaryBasicIdMapper());
What I've Tried:
- Verified that peer-class loading is enabled on both client and Server.
- Ensured that the compute task is deployed on the client-side.
- Checked if the class exists in the client project and is accessible.
- Confirmed that binary marshalling configuration is consistent between the server and client.
Question:
Why am I encountering ClassNotFoundException
even though peer-class loading is enabled? How can I ensure that the compute task and related classes are properly loaded when executing the task on the server?
Any insights or solutions would be greatly appreciated. Thanks!
Share Improve this question asked Mar 21 at 13:16 prashant notaniprashant notani 11 bronze badge 2 |1 Answer
Reset to default 0While you can use peer class loading for classes used for compute, it's not possible to use it to deploy "model" classes.
You can manually copy the JAR file containing your model classes to the server nodes, use URI deployment, or managed deployment if you're using GridGain's Control Center.
You can continue to use peer class loading for the rest of the code.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744350804a4569963.html
Abc
a POJO used to define the content of one of your tables? – Stephen Darlington Commented Mar 21 at 13:42