Quantcast

Deserialization error with ArrayCollection

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Deserialization error with ArrayCollection

harelba
Hi,

I'm having trouble when getting a response from my java server: "TypeError: list indices must be integers, not str".

This happens while trying to deserialize a response of type X which contains a Collection<X> as one of its properties.

I've added a print to /util/__init__.py in order to see the parameters to the set_attrs method and it's as follows (Xn are instances of the client-side X class which was defined using pyamf.register_class):

attrs = {'source': [X1, X2,X3]}
obj <flex.messaging.io.ArrayCollection []>

There seems to be a ticket (#716) which was opened on the same error and marked as invalid due to some network problem, but i don't think that this is the case here....

Any help would be appreciated.
RL

Here is the traceback (removed lots of repeating stuff in the middle...):
----------------------------------
Traceback (most recent call last):
  File "./get-initial-location", line 12, in <module>
    print ms.getInitialLocation(None)
  File "/usr/local/lib/python2.7/dist-packages/PyAMF-0.6.1-py2.7-linux-i686.egg/pyamf/remoting/client/__init__.py", line 52, in __call__
    return self.service._call(self, *args)
  File "/usr/local/lib/python2.7/dist-packages/PyAMF-0.6.1-py2.7-linux-i686.egg/pyamf/remoting/client/__init__.py", line 101, in _call
    response = self._gw.execute_single(request)
  File "/usr/local/lib/python2.7/dist-packages/PyAMF-0.6.1-py2.7-linux-i686.egg/pyamf/remoting/client/__init__.py", line 388, in execute_single
    envelope = self._getResponse(http_request)
  File "/usr/local/lib/python2.7/dist-packages/PyAMF-0.6.1-py2.7-linux-i686.egg/pyamf/remoting/client/__init__.py", line 467, in _getResponse
    response = remoting.decode(bytes, strict=self.strict)
  File "/usr/local/lib/python2.7/dist-packages/PyAMF-0.6.1-py2.7-linux-i686.egg/pyamf/remoting/__init__.py", line 626, in decode
    target, payload = _read_body(stream, decoder, strict, logger)
  File "/usr/local/lib/python2.7/dist-packages/PyAMF-0.6.1-py2.7-linux-i686.egg/pyamf/remoting/__init__.py", line 459, in _read_body
    data = decoder.readElement()
  File "codec.pyx", line 359, in cpyamf.codec.Decoder.readElement (cpyamf/codec.c:5195)
  File "codec.pyx", line 372, in cpyamf.codec.Decoder.readElement (cpyamf/codec.c:5090)
  File "amf0.pyx", line 292, in cpyamf.amf0.Decoder.readConcreteElement (cpyamf/amf0.c:3926)
.....................
.....................
  File "amf0.pyx", line 164, in cpyamf.amf0.Decoder.readTypedObject (cpyamf/amf0.c:2629)
  File "/usr/local/lib/python2.7/dist-packages/PyAMF-0.6.1-py2.7-linux-i686.egg/pyamf/alias.py", line 527, in applyAttributes
    util.set_attrs(obj, attrs)
  File "/usr/local/lib/python2.7/dist-packages/PyAMF-0.6.1-py2.7-linux-i686.egg/pyamf/util/__init__.py", line 91, in set_attrs
    [o(obj, k, v) for k, v in attrs.iteritems()]
TypeError: list indices must be integers, not str
Loading...