JPython serialization problem

Emmanuel Pietriga emmanuel.pietriga at inrialpes.fr
Mon Jan 10 02:42:47 EST 2000


I forgot to mention that I'm running JPython1.1beta2  with JDK 1.1.7B



Emmanuel Pietriga wrote:

> My problem is rather "hard" to explain, so I'll take an example:
>
> I have two applications which communicate using a socket:
> One is written in Java and sends serialized objects to the other one,
> written in python, which uses java classes (therefore it runs under
> JPython).
> The python application receives serialized objects from the java
> application.
>
> I use java.io.ObjectOutputStream.writeObject() on the java side, and
> ObjectInputStream.readObject() on the python side.
>
> Of course, the objects I send all implement the Serializable interface.
>
> Here's the problem:
>     if I send an instance of a class which is part of the standard Java
> API  (like Vector, Hashtable, or even awt.Label,.....) everything is
> fine.
>     but if I send objects of a class created by me, no matter how simple
> the class is, I get a NoClassDefFound exception on the python side when
> reading the serialized object from the objectinputstream.
>
> At first I thought the paths were defined incorrectly, but if I create
> an instance of the same class directly on the python side using its
> constructor, it works!  Therefore JPython knows where to find the class
> definition.
>
> Anyone can help?
>
> Thanks.

--
Emmanuel Pietriga
OPERA
emmanuel.pietriga at inrialpes.fr






More information about the Python-list mailing list