ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sam Adams <sbad...@gmail.com>
Subject Can't return lambda when peer class loading
Date Tue, 08 Sep 2015 11:20:14 GMT
Hi,

It looks like I'm unable to return a lambda from a compute job.

Here is the stack trace:

Exception in thread "main" class org.apache.ignite.IgniteException: Failed
to find class with given class loader for unmarshalling (make sure same
version of all classes are available on all nodes or enable
peer-class-loading): sun.misc.Launcher$AppClassLoader@c387f44 at
org.apache.ignite.internal.util.IgniteUtils.convertException(IgniteUtils.java:684)
at
org.apache.ignite.internal.IgniteComputeImpl.call(IgniteComputeImpl.java:352)
at simulator.IgniteLambdaTest.run(IgniteLambdaTest.java:40) at
simulator.IgniteLambdaTest.main(IgniteLambdaTest.java:31) Caused by: class
org.apache.ignite.IgniteCheckedException: Failed to find class with given
class loader for unmarshalling (make sure same version of all classes are
available on all nodes or enable peer-class-loading):
sun.misc.Launcher$AppClassLoader@c387f44 at
org.apache.ignite.marshaller.optimized.OptimizedMarshaller.unmarshal(OptimizedMarshaller.java:242)
at
org.apache.ignite.internal.processors.task.GridTaskWorker.onResponse(GridTaskWorker.java:693)
at
org.apache.ignite.internal.processors.task.GridTaskProcessor.processJobExecuteResponse(GridTaskProcessor.java:932)
at
org.apache.ignite.internal.processors.task.GridTaskProcessor$JobMessageListener.onMessage(GridTaskProcessor.java:1156)
at
org.apache.ignite.internal.managers.communication.GridIoManager.processRegularMessage0(GridIoManager.java:761)
at
org.apache.ignite.internal.managers.communication.GridIoManager.access$1500(GridIoManager.java:59)
at
org.apache.ignite.internal.managers.communication.GridIoManager$5.run(GridIoManager.java:724)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745) Caused by:
java.lang.ClassNotFoundException:
simulator.IgniteLambdaTest$SimulationJob$$Lambda$144/739267424 at
java.lang.Class.forName0(Native Method) at
java.lang.Class.forName(Class.java:348) at
org.apache.ignite.internal.util.IgniteUtils.forName(IgniteUtils.java:7911)
at
org.apache.ignite.internal.MarshallerContextAdapter.getClass(MarshallerContextAdapter.java:177)
at
org.apache.ignite.marshaller.optimized.OptimizedMarshallerUtils.classDescriptor(OptimizedMarshallerUtils.java:252)
at
org.apache.ignite.marshaller.optimized.OptimizedObjectInputStream.readObjectOverride(OptimizedObjectInputStream.java:246)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:365) at
org.apache.ignite.marshaller.optimized.OptimizedObjectInputStream.readFields(OptimizedObjectInputStream.java:419)
at
org.apache.ignite.marshaller.optimized.OptimizedObjectInputStream.readSerializable(OptimizedObjectInputStream.java:507)
at
org.apache.ignite.marshaller.optimized.OptimizedClassDescriptor.read(OptimizedClassDescriptor.java:751)
at
org.apache.ignite.marshaller.optimized.OptimizedObjectInputStream.readObjectOverride(OptimizedObjectInputStream.java:252)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:365) at
org.apache.ignite.marshaller.optimized.OptimizedMarshaller.unmarshal(OptimizedMarshaller.java:236)
... 9 more

Here is a minimal test case:

protected void run() throws Exception {
try (Ignite ignite = Ignition.start(igniteConfigPath)) {
ClusterGroup remotes = ignite.cluster().forRemotes();
List<SimulationJob> jobs = IntStream.range(0, 100).mapToObj((x) -> new
TestJob()).collect(toList());
Collection<LambdaStrategy<?>> result = ignite.compute(remotes).call(jobs);
result.stream().forEach(System.out::println);
}
}
class TestJob implements IgniteCallable<LambdaStrategy<?>> {
@Override
public LambdaStrategy<Object> call() throws Exception {
return new LambdaStrategy<Object>((x) -> false);
}
}

Is this a known issue/limitation?

Thanks,

Sam

Mime
View raw message