RemoteClassLoader doesn't provide ClassFile information for Lambdas
Brian Oliver
brian.oliver at oracle.com
Wed Mar 8 17:54:47 UTC 2017
I’m attempting to use JShell with Coherence (for distributed lambdas / distributed streams) and I’ve noticed that some lambda expressions defined by the Shell are not available / resolvable via the RemoteClassLoader as expected.
For example: (assume RockStars is a Map<UID, String> where the String is “firstname lastname”)
The following attempts to determine the distinct number of rockstar last names.
jshell> rockstars.stream().map(e -> e.getValue().split(" ")[1]).distinct().count();
| java.lang.IllegalStateException thrown: ClassFile for the remote lambda could not be introspected. jdk.jshell.execution.DefaultLoaderDelegate$RemoteClassLoader at 91161c7.getResource(REPL/$JShell$20.class) unexpectedly returned null
| at RemotableSupport.createRemoteConstructor (RemotableSupport.java:82)
| at Lambdas.ensureRemotable (Lambdas.java:205)
| at RemoteStream.map (RemoteStream.java:154)
| at (#10:1)
Coherence is asking for the ClassFile instance in which a (remote) lambda is defined, but it’s not available via the RemoteClassLoader.
I’m wondering if the DefaultLoaderDelegate$RemoteClassLoader is missing support for resolving Lambdas?
Without this support we can’t really demonstrate using remote / distributed lambdas / distributed lambdas across a Cloud - which would be very helpful!
Thoughts?
— Brian
More information about the kulla-dev
mailing list