Issue1394

classification
Title: Serialization of Jython objects from Java bugged - across a reset Jython state.
Type: Severity: normal
Components: Core Versions: Jython 2.5
Milestone:
process
Status: closed Resolution: invalid
Dependencies: Superseder:
Assigned To: Nosy List: fwierzbicki, pjenvey, random_jython_user, zyasoft
Priority: Keywords:

Created on 2009-07-03.15:16:54 by random_jython_user, last changed 2014-06-17.22:44:25 by zyasoft.

Files
File name Uploaded Description Edit Remove
A.java random_jython_user, 2009-07-08.13:19:03
PyTest.py random_jython_user, 2009-07-08.13:19:17
Test.java random_jython_user, 2009-07-08.13:19:31
Messages
msg4878 (view) Author: anonymous (random_jython_user) Date: 2009-07-03.15:16:54
Serialization of Jython objects that implement Serializable is bugged in
Java - across a new instance of the JVM.  

Serializing and reading in from the same instance of the JVM works fine.

When reading in from a different instance of the JVM, the JVM throws an
exception about the Jython proxy class not being found.
msg4889 (view) Author: Philip Jenvey (pjenvey) Date: 2009-07-08.00:53:23
Can you provide the output of the actual exception?
msg4892 (view) Author: anonymous (random_jython_user) Date: 2009-07-08.13:19:03
OK... I've also added the Java/Python code that causes this problem.

Exception in thread "main" java.lang.ClassNotFoundException:
org.python.proxies.main$PyTest$0
	at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:336)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:264)
	at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:621)
	at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1592)
	at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1513)
	at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1749)
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1346)
	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:368)
	at Test.main(Test.java:28)
msg8503 (view) Author: Jim Baker (zyasoft) Date: 2014-05-21.23:37:04
I'm pretty sure this is expected behavior on the JVM. Clamp offers a solution by allowing seralVersionUUID to be pinned (by default to 1L); please see https://github.com/jimbaker/clamped for an example.

We should document this functionality for Clamp as well.
History
Date User Action Args
2014-06-17 22:44:25zyasoftsetstatus: pending -> closed
2014-05-21 23:37:05zyasoftsetstatus: open -> pending
resolution: invalid
messages: + msg8503
nosy: + zyasoft
2013-02-19 19:06:18fwierzbickisetnosy: + fwierzbicki
2013-02-19 19:05:51fwierzbickisetversions: + Jython 2.5, - 2.5.0
2009-07-08 13:19:31random_jython_usersetfiles: + Test.java
2009-07-08 13:19:17random_jython_usersetfiles: + PyTest.py
2009-07-08 13:19:04random_jython_usersetfiles: + A.java
messages: + msg4892
2009-07-08 00:53:23pjenveysetnosy: + pjenvey
messages: + msg4889
2009-07-03 15:16:54random_jython_usercreate