From: Sherrell, D. <dsh...@ad...> - 2010-02-16 19:32:53
|
One more thing..the trace shows that the problem occurs in the pyamf codec..but it is at the point that the Message constructor is invoked and at some point the recursion depth is exceeded... Exception in thread Thread:Traceback (most recent call last): File "c:\Jython\Lib\threading.py", line 178, in _Thread__bootstrap self.run() File "__pyclasspath__/MessageInterfaceClient.py", line 99, in run File "c:\Python26\Lib\pyamf\__init__.py", line 1050, in decode yield decoder.readElement() File "c:\Python26\Lib\pyamf\__init__.py", line 1050, in decode yield decoder.readElement() File "c:\Python26\Lib\pyamf\__init__.py", line 677, in readElement return func() File "c:\Python26\Lib\pyamf\amf0.py", line 310, in readTypedObject ret = alias.createInstance(codec=self) File "c:\Python26\Lib\pyamf\amf0.py", line 310, in readTypedObject ret = alias.createInstance(codec=self) File "c:\Python26\Lib\pyamf\__init__.py", line 562, in createInstance return self.klass(*args, **kwargs) File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 312, in __init__ Message.__init__(self) File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 90, in __init__ self.length = 0 File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val File "C:\RIB AFE Collaborative\AFE_Interface\src\message_interface.py", line 121, in setLength self.length = val -----Original Message----- From: Sherrell, Dana Sent: Tuesday, February 16, 2010 11:14 AM To: Alex Grönholm; jyt...@li... Subject: Re: [Jython-users] use jython object from java Allright, So I have a MessageInterface interface in Java as: package jyinterface.interfaces; public interface MessageInterface { public int getSource(); public int getDestination(); public int getLength(); public int getVersion(); public int getMessageID(); public int setSource(int val); public int setDestination(int val); public int setLength(int val); public int setVersion(int val); public int setMessageID(int val); } And a jython object that implements the interface: class Message(MessageInterface): def __init__(self): """@sig Message()""" self.length = 0 self.msg_verion = 0 self.source = 0 self.destination = 0 self.Message_ID = 0 f=open(path + 'Message.txt','r') #dictionary containing class attribute information useful for encode/decode #has keys: type complex_name bits name dimensions self.properties = pickle.load(f) f.close() def getLength(self): return self.length def getSource(self): return self.source def getDestination(self): return self.destination def getMessageID(self): return self.Message_ID def getVersion(self): return self.msg_version def setLength(self, val): self.length = val def setSource(self, val): self.source = val def setDestination(self, val): self.destination = val def setMessageId(self, val): self.Message_ID = val def setVersion(self, val): self.msg_version = val there is another jython object that inherits the Message object like this: class Network_Definition_Fields(NetworkDefinitionInterface,Message): def __init__(self, message = None): Message.__init__(self) self.number_of_subnets = None self.Preset_Net_Profiles = None .... .... when this object is instantiated in the jython code and Message.__init__ is invoked, I get an error self.length = val RunTimeError: maximum recursion depth exceeded A little background..i have existing python code that I am trying to integrate with java. So I'm using jython as the glue rather than being in a situation where I am developing code from scratch. Could my problem here be that I am inheriting from both the NetworkDefinitionInterface and Message? Your help is greatly appreciated. Thanks, Dana -----Original Message----- From: Alex Grönholm [mailto:ale...@ne...] Sent: Tuesday, February 16, 2010 9:08 AM To: jyt...@li... Subject: Re: [Jython-users] use jython object from java 16.2.2010 18:48, Sherrell, Dana kirjoitti: Hello, I am fairly new to java/jython integration so please be patient. I followed the jython factory examples to use the interpreter to call my jython objects and all is well until I need to access a user defined object in jython from java. The examples that I have seen use simple types in the interfaces.i need to access a complex data type. How do I access a user defined type - defined in the jython module - in my java app? So if my interface looked something like: public interface AFE_ClientInterface { public int messageId(); public String clientName(); public NetworkDefinition getNetworkDefinition(); .. .. public void shutDown(); } How do I translate the jython NetworkDefinition object into one that java can understand? Thanks, Dana You have to have a Java interface for NetworkDefinition, and the corresponding Jython class must inherit from that. ------------------------------------------------------------------------------ SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev _______________________________________________ Jython-users mailing list Jyt...@li... https://lists.sourceforge.net/lists/listinfo/jython-users |