Little client Problem

Tech talk for MV3D developers or those looking to lend a hand.

Moderator: SirGolan

Little client Problem

Postby jhamel » Fri Aug 05, 2011 5:50 pm

Hi,
I am just change something at the viewer. To use it with the Panda3d deployment and packp3d we must do change something. So I replace the pyode stuff with the Panda ODE stuff. I set also a WX window around it and try to set the tool in a menu. Last not least I must change the import path, because the pack3pd needs a python start file on top of the directory. So I move the viewer files to ./viewer/mv3d_p3d and also I change the import from "from mv3d.xxxx import yyyy" to "from viewer.mv3d_p3d.mv3d.xxxx import yyyy" and so on. I works not so bad, lol, but after I connect with the viewer to the server, login as admin and choose the "Panda Player" I get now this error.
Code: Select all
2011-08-05 19:36:25+0200 [HTTPPageGetter,client] Connected.
2011-08-05 19:36:25+0200 [HTTPPageGetter,client] Stopping factory <HTTPClientFactory: https://cuonsim2.de:8080/service/>
2011-08-05 19:36:39+0200 [Broker,client] Peer will receive following PB traceback:
2011-08-05 19:36:39+0200 [Broker,client] Unhandled Error
   Traceback (most recent call last):
     File "/usr/lib/python2.7/dist-packages/twisted/spread/banana.py", line 153, in gotItem
       self.callExpressionReceived(item)
     File "/usr/lib/python2.7/dist-packages/twisted/spread/banana.py", line 116, in callExpressionReceived
       self.expressionReceived(obj)
     File "/usr/lib/python2.7/dist-packages/twisted/spread/pb.py", line 514, in expressionReceived
       method(*sexp[1:])
     File "/usr/lib/python2.7/dist-packages/twisted/spread/pb.py", line 826, in proto_message
       self._recvMessage(self.localObjectForID, requestID, objectID, message, answerRequired, netArgs, netKw)
   --- <exception caught here> ---
     File "/usr/lib/python2.7/dist-packages/twisted/spread/pb.py", line 840, in _recvMessage
       netResult = object.remoteMessageReceived(self, message, netArgs, netKw)
     File "/usr/lib/python2.7/dist-packages/twisted/spread/flavors.py", line 209, in remoteMessageReceived
       args = broker.unserialize(args, self.perspective)
     File "/usr/lib/python2.7/dist
2011-08-05 19:36:25+0200 [HTTPPageGetter,client] Connected.
2011-08-05 19:36:25+0200 [HTTPPageGetter,client] Stopping factory <HTTPClientFactory: https://cuonsim2.de:8080/service/>
2011-08-05 19:36:39+0200 [Broker,client] Peer will receive following PB traceback:
2011-08-05 19:36:39+0200 [Broker,client] Unhandled Error
   Traceback (most recent call last):
     File "/usr/lib/python2.7/dist-packages/twisted/spread/banana.py", line 153, in gotItem
       self.callExpressionReceived(item)
     File "/usr/lib/python2.7/dist-packages/twisted/spread/banana.py", line 116, in callExpressionReceived
       self.expressionReceived(obj)
     File "/usr/lib/python2.7/dist-packages/twisted/spread/pb.py", line 514, in expressionReceived
       method(*sexp[1:])
     File "/usr/lib/python2.7/dist-packages/twisted/spread/pb.py", line 826, in proto_message
       self._recvMessage(self.localObjectForID, requestID, objectID, message, answerRequired, netArgs, netKw)
   --- <exception caught here> ---
     File "/usr/lib/python2.7/dist-packages/twisted/spread/pb.py", line 840, in _recvMessage
       netResult = object.remoteMessageReceived(self, message, netArgs, netKw)
     File "/usr/lib/python2.7/dist-packages/twisted/spread/flavors.py", line 209, in remoteMessageReceived
       args = broker.unserialize(args, self.perspective)
     File "/usr/lib/python2.7/dist-packages/twisted/spread/pb.py", line 776, in unserialize
       return unjelly(sexp, self.security, None, self)
     File "/usr/lib/python2.7/dist-packages/twisted/spread/jelly.py", line 1136, in unjelly
       return _Unjellier(taster, persistentLoad, invoker).unjellyFull(sexp)
     File "/usr/lib/python2.7/dist-packages/twisted/spread/jelly.py", line 632, in unjellyFull
       o = self.unjelly(obj)
     File "/usr/lib/python2.7/dist-packages/twisted/spread/jelly.py", line 669, in unjelly
       ret = thunk(obj[1:])
     File "/usr/lib/python2.7/dist-packages/twisted/spread/jelly.py", line 783, in _unjelly_tuple
       if isinstance(self.unjellyInto(l, elem, lst[elem]), NotKnown):
     File "/usr/lib/python2.7/dist-packages/twisted/spread/jelly.py", line 747, in unjellyInto
       o = self.unjelly(jel)
     File "/usr/lib/python2.7/dist-packages/twisted/spread/jelly.py", line 669, in unjelly
       ret = thunk(obj[1:])
     File "/usr/lib/python2.7/dist-packages/twisted/spread/jelly.py", line 794, in _unjelly_list
       self.unjellyInto(l, elem, lst[elem])
     File "/usr/lib/python2.7/dist-packages/twisted/spread/jelly.py", line 747, in unjellyInto
       o = self.unjelly(jel)
     File "/usr/lib/python2.7/dist-packages/twisted/spread/jelly.py", line 675, in unjelly
       "Module %s not allowed (in type %s)." % (modName, jelType))
   twisted.spread.jelly.InsecureJelly: Module mv3d.util.classgen not allowed (in type mv3d.util.classgen.ClassGenerator).
   
2011-08-05 19:36:39+0200 [Broker,client] Unhandled Error
   Traceback (most recent call last):
   Failure: viewer.mv3d_p3d.mv3d.util.conductor.RemoteException: mv3d.util.conductor.RemoteException: twisted.spread.jelly.InsecureJelly: Module mv3d.util.classgen not allowed (in type mv3d.util.classgen.ClassGenerator).
   
2011-08-05 19:36:39+0200 [Broker,client] mainwindow path =  /misc/Projekte/py3d-worlds/etc/client/mainmenu.xml
-packages/twisted/spread/pb.py", line 776, in unserialize
       return unjelly(sexp, self.security, None, self)
     File "/usr/lib/python2.7/dist-packages/twisted/spread/jelly.py", line 1136, in unjelly
       return _Unjellier(taster, persistentLoad, invoker).unjellyFull(sexp)
     File "/usr/lib/python2.7/dist-packages/twisted/spread/jelly.py", line 632, in unjellyFull
       o = self.unjelly(obj)
     File "/usr/lib/python2.7/dist-packages/twisted/spread/jelly.py", line 669, in unjelly
       ret = thunk(obj[1:])
     File "/usr/lib/python2.7/dist-packages/twisted/spread/jelly.py", line 783, in _unjelly_tuple
       if isinstance(self.unjellyInto(l, elem, lst[elem]), NotKnown):
     File "/usr/lib/python2.7/dist-packages/twisted/spread/jelly.py", line 747, in unjellyInto
       o = self.unjelly(jel)
     File "/usr/lib/python2.7/dist-packages/twisted/spread/jelly.py", line 669, in unjelly
       ret = thunk(obj[1:])
     File "/usr/lib/python2.7/dist-packages/twisted/spread/jelly.py", line 794, in _unjelly_list
       self.unjellyInto(l, elem, lst[elem])
     File "/usr/lib/python2.7/dist-packages/twisted/spread/jelly.py", line 747, in unjellyInto
       o = self.unjelly(jel)
     File "/usr/lib/python2.7/dist-packages/twisted/spread/jelly.py", line 675, in unjelly
       "Module %s not allowed (in type %s)." % (modName, jelType))
   twisted.spread.jelly.InsecureJelly: Module mv3d.util.classgen not allowed (in type mv3d.util.classgen.ClassGenerator).
   
2011-08-05 19:36:39+0200 [Broker,client] Unhandled Error
   Traceback (most recent call last):
   Failure: viewer.mv3d_p3d.mv3d.util.conductor.RemoteException: mv3d.util.conductor.RemoteException: twisted.spread.jelly.InsecureJelly: Module mv3d.util.classgen not allowed (in type mv3d.util.classgen.ClassGenerator).
   
2011-08-05 19:36:39+0200 [Broker,client] mainwindow path =  /misc/Projekte/py3d-worlds/etc/client/mainmenu.xml

I have really no idea, where I must search for this error, is it on the server site ? Get it a wrong classname now ( after this changes ? ).
Perhaps some of you has an idea ?

bye
Juergen
jhamel
 
Posts: 17
Joined: Fri Jul 15, 2011 11:07 am

Re: Little client Problem

Postby SirGolan » Sat Aug 06, 2011 12:36 am

I'm pretty sure I know what's going on here. MV3D uses Twisted's PB (Perspective Broker) protocol which requires that you register any class that you expect to send from the server to the client using this call:

pb.setUnjellyableForClass(serverClass, clientClass)

The server class can also just be a string like "mv3d.util.classgen.ClassGenerator" that specifies the module and class. When you changed the import path, that messed that stuff up. While you could probably fix it for the error you mentioned (ClassGenerator), there are many times when the server sends this information down to the client, so if the module path on the server is different from the client, it wouldn't work.

You should check out bin/pandabuild.bat which creates p3d files for the client and tools with Panda. I haven't tried it on Linux yet (it would of course need a bash script instead of batch file), but it should generally work.

Hope that helps!

Thanks,

Mike
SirGolan
Site Admin
 
Posts: 214
Joined: Wed Mar 19, 2008 7:04 pm


Return to Development

Who is online

Users browsing this forum: No registered users and 2 guests

cron