vbuell / python-javaobj

python-javaobj is a python library that provides functions for reading of Java objects serialized ObjectOutputStream.
Apache License 2.0
14 stars 8 forks source link

Deserialized Java Objects from socket python #1

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago

What is the expected output? What do you see instead?

The output that I expect is deserialize java object that is serialized by Java 
ObjectOutputStream and read from the socket by socket python method. recv

I see this error:
No handlers could be found for logger "javaobj"
Traceback (most recent call last):
  File "/home/aledani85/workspace/tesiinf2/src/cspackage/ClientSock.py", line 28, in <module>
    stringa=javaobj.loads(pippo)
  File "/home/aledani85/Scaricati/javaobj-0.1.0-py2.6.egg/javaobj.py", line 45, in loads
  File "/home/aledani85/Scaricati/javaobj-0.1.0-py2.6.egg/javaobj.py", line 159, in readObject
  File "/home/aledani85/Scaricati/javaobj-0.1.0-py2.6.egg/javaobj.py", line 181, in _read_and_exec_opcode
  File "/home/aledani85/Scaricati/javaobj-0.1.0-py2.6.egg/javaobj.py", line 190, in _readStruct
struct.error: unpack requires a string argument of length 1

What version of the product are you using? On what operating system?
The version used is:0.1.0.The operating system is Ubuntu karmic 8.04

Please provide any additional information below.

is possible using this form deserialize Java objects into python objects? I 
will have to pass along a serialized Java objects form python.This form must 
then serialize the object before bed to send a second Java class which will 
read the object.

Thanks for the help. Congratulations on this very interesting form.

Original issue reported on code.google.com by Padiglio...@gmail.com on 1 Apr 2011 at 4:06

Attachments:

GoogleCodeExporter commented 9 years ago
Could you provide Java Class which you're trying to deserialize? There was some 
issues with handling classes with custom serialization method (with overridden 
writeObject() or even worst: implementing Externalizable interface) which could 
be your case.

PS: Sorry for long delay...

Original comment by vbu...@gmail.com on 15 Apr 2011 at 12:45

GoogleCodeExporter commented 9 years ago
BTW, try to deserialize your object from file. Error "unpack requires a string 
argument of length 1" can occurs when your stream has been ended unexpectedly 
while unmarshaling (ex socket issues).

Original comment by vbu...@gmail.com on 29 Apr 2011 at 5:32