last day (14 days later) » 

1:54 PM
0
A: how to use pyro to call python with object as parameter

Mike MüllerTry setting the serializer to pickle: Pyro4.config.SERIALIZER = 'pickle' Be aware that this has security implications. And this in Java: Config.SERIALIZER = Config.SerializerType.pickle;

 
same error, is there a certian place this needs to be? I added it just before the print of the uri
 
Put it at the very first line and re-start everything.
 
I now get an error that is too long to paste in but says this on one line: Pyro4.errors.SerializeError: message used serializer that is not accepted: 4. This happens when starting the server and not when trying to call the method from java
checking the config its accepted serializers are serpent, marshal, and json. its using serpent currently which is what it should also be doing on the java side as thats the jar I have on my classpath
added pickle to set of serializers and tried above but still get same error
 
Where does com.test.pyro4.TestLog com from?
 
thats the java class I am trying to pass to the python side
 
1:54 PM
Did you try with primitve types like int? Does it work?
 
I am using pyrolite on the java side. I have tried it with primitives and arrays and it works great, just not with my own objects.
 
Did you try turning on pickle on the Java side? See my modification of the answer.
 
hello
I have gotten a bit further now i think its past the serialization
 
So it works?
Or another exceptions?
 
I changed it so that the class is defined on the python side, I then register the class with the name server and then request it on the java side as proxy object. it then fills up the object with what it needs via a call to the python side and then it calls the calculate method with the proxy object, a bit convoluted but its now past serialisation and failing inside my calculate with an 'iterable is not a float' error
if you like I can share my code? I'll add it to the thread anyways as it seems pretty handy and there wasn't really an answer anywhere
 
2:01 PM
Yes. Just solve the riddle for others who might have the same problem.
 
yes just need to get past this:
TypeError: 'float' object is not iterable
 
Take your time.
 

last day (14 days later) »