ignite-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Avihai Berkovitz (JIRA)" <j...@apache.org>
Subject [jira] [Created] (IGNITE-2450) Proxy classes are not serialized properly using OptimizedMarshaller and BinaryMarshaller
Date Tue, 26 Jan 2016 12:06:40 GMT
Avihai Berkovitz created IGNITE-2450:
----------------------------------------

             Summary: Proxy classes are not serialized properly using OptimizedMarshaller
and BinaryMarshaller
                 Key: IGNITE-2450
                 URL: https://issues.apache.org/jira/browse/IGNITE-2450
             Project: Ignite
          Issue Type: Bug
          Components: interop
    Affects Versions: 1.5.0.final, ignite-1.4
         Environment: Ubuntu 12.04 64 bit
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
Ignite 1.4.0
            Reporter: Avihai Berkovitz


I tried to deploy several services using Java's Proxy class, to dynamically define the needed
interfaces. When using a single process (even with several nodes running in the same JVM)
everything worked. But when working with a large cluster of several machines I got the following
error:
{noformat}
Error when executing service: ServicePluginsDeployer
org.apache.ignite.IgniteException: Failed to unmarshall object.
        at org.apache.ignite.internal.processors.cache.CacheObjectImpl.value(CacheObjectImpl.java:84)
~[ignite-core-1.5.0.final.jar:1.5.0.final]
        at org.apache.ignite.internal.processors.cache.CacheObjectContext.unwrapBinary(CacheObjectContext.java:280)
~[ignite-core-1.5.0.final.jar:1.5.0.final]
        at org.apache.ignite.internal.processors.cache.CacheObjectContext.unwrapBinaryIfNeeded(CacheObjectContext.java:145)
~[ignite-core-1.5.0.final.jar:1.5.0.final]
        at org.apache.ignite.internal.processors.cache.CacheObjectContext.unwrapBinaryIfNeeded(CacheObjectContext.java:132)
~[ignite-core-1.5.0.final.jar:1.5.0.final]
        at org.apache.ignite.internal.processors.cache.GridCacheMapEntry$LazyValueEntry.getValue(GridCacheMapEntry.java:4339)
~[ignite-core-1.5.0.final.jar:1.5.0.final]
        at org.apache.ignite.internal.processors.service.GridServiceProcessor$TopologyListener$1.run0(GridServiceProcessor.java:1214)
~[ignite-core-1.5.0.final.jar:1.5.0.final]
        at org.apache.ignite.internal.processors.service.GridServiceProcessor$BusyRunnable.run(GridServiceProcessor.java:1399)
~[ignite-core-1.5.0.final.jar:1.5.0.final]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_60]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_60]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[na:1.8.0_60]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[na:1.8.0_60]
        at java.lang.Thread.run(Thread.java:745) [na:1.8.0_60]
Caused by: 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): null
        at org.apache.ignite.marshaller.optimized.OptimizedMarshaller.unmarshal(OptimizedMarshaller.java:254)
~[ignite-core-1.5.0.final.jar:1.5.0.final]
        at org.apache.ignite.internal.processors.cacheobject.IgniteCacheObjectProcessorImpl.unmarshal(IgniteCacheObjectProcessorImpl.java:110)
~[ignite-core-1.5.0.final.jar:1.5.0.final]
        at org.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl.unmarshal(CacheObjectBinaryProcessorImpl.java:700)
~[ignite-core-1.5.0.final.jar:1.5.0.final]
        at org.apache.ignite.internal.processors.cache.CacheObjectImpl.value(CacheObjectImpl.java:76)
~[ignite-core-1.5.0.final.jar:1.5.0.final]
        ... 11 common frames omitted
Caused by: java.lang.ClassNotFoundException: com.sun.proxy.$Proxy55
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_60]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_60]
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) ~[na:1.8.0_60]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_60]
        at java.lang.Class.forName0(Native Method) ~[na:1.8.0_60]
        at java.lang.Class.forName(Class.java:348) ~[na:1.8.0_60]
        at org.apache.ignite.internal.util.IgniteUtils.forName(IgniteUtils.java:8172) ~[ignite-core-1.5.0.final.jar:1.5.0.final]
        at org.apache.ignite.internal.MarshallerContextAdapter.getClass(MarshallerContextAdapter.java:185)
~[ignite-core-1.5.0.final.jar:1.5.0.final]
        at org.apache.ignite.marshaller.optimized.OptimizedMarshallerUtils.classDescriptor(OptimizedMarshallerUtils.java:267)
~[ignite-core-1.5.0.final.jar:1.5.0.final]
        at org.apache.ignite.marshaller.optimized.OptimizedObjectInputStream.readObjectOverride(OptimizedObjectInputStream.java:309)
~[ignite-core-1.5.0.final.jar:1.5.0.final]
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:365) ~[na:1.8.0_60]
        at org.apache.ignite.marshaller.optimized.OptimizedObjectInputStream.readFields(OptimizedObjectInputStream.java:482)
~[ignite-core-1.5.0.final.jar:1.5.0.final]
        at org.apache.ignite.marshaller.optimized.OptimizedObjectInputStream.readSerializable(OptimizedObjectInputStream.java:570)
~[ignite-core-1.5.0.final.jar:1.5.0.final]
        at org.apache.ignite.marshaller.optimized.OptimizedClassDescriptor.read(OptimizedClassDescriptor.java:808)
~[ignite-core-1.5.0.final.jar:1.5.0.final]
        at org.apache.ignite.marshaller.optimized.OptimizedObjectInputStream.readObjectOverride(OptimizedObjectInputStream.java:315)
~[ignite-core-1.5.0.final.jar:1.5.0.final]
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:365) ~[na:1.8.0_60]
        at org.apache.ignite.marshaller.optimized.OptimizedObjectInputStream.readFields(OptimizedObjectInputStream.java:482)
~[ignite-core-1.5.0.final.jar:1.5.0.final]
        at org.apache.ignite.marshaller.optimized.OptimizedObjectInputStream.readSerializable(OptimizedObjectInputStream.java:570)
~[ignite-core-1.5.0.final.jar:1.5.0.final]
        at org.apache.ignite.marshaller.optimized.OptimizedClassDescriptor.read(OptimizedClassDescriptor.java:808)
~[ignite-core-1.5.0.final.jar:1.5.0.final]
        at org.apache.ignite.marshaller.optimized.OptimizedObjectInputStream.readObjectOverride(OptimizedObjectInputStream.java:315)
~[ignite-core-1.5.0.final.jar:1.5.0.final]
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:365) ~[na:1.8.0_60]
        at org.apache.ignite.marshaller.optimized.OptimizedMarshaller.unmarshal(OptimizedMarshaller.java:248)
~[ignite-core-1.5.0.final.jar:1.5.0.final]
        ... 14 common frames omitted
{noformat}

I think the problem is that the marshaller tries to reference the proxy class by name, but
deserialization of proxy classes should be special ([https://docs.oracle.com/javase/8/docs/technotes/guides/reflection/proxy.html#serial])
and create the classes on the fly. When using the JdkMarshaller the problem doesn't happen.
This problem doesn't show up in existing tests (IGNITE-2098) because they all run in the same
JVM, where the same proxy classes exist before and after serialization. You must have nodes
in two different processes, and create several proxy classes, for the problem to manifest.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message