ArrayCollection Problem in AMFBinaryData.as

classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|

ArrayCollection Problem in AMFBinaryData.as

doug777
My RemoteObject returns a complex Object in part of which CF has specified
what looks to me like a simple array as an ArrayCollection in the returned
AMF Data. (Works ok in the old SWF project.)

Stepping through the code in the browser debugger, when the reader reaches
the n of ArrayCollection in reader.data, it immediately errors with the
message :

e : "Failed to deserialize: Failed to deserialize: Failed to deserialize:
ReferenceError: Class flex.messaging.io.ArrayCollection could not be found."

Looking into AMFBinaryData.as, I can see that the execution (after reading
in "ArrayCollection") follows the path to readScriptObject() at line 868 and
then goes to line 877.

Unfortunately traits.alias is true and it then fails when trying to get the
classAlias. It looks to me as though lines 894 - 898 or something like this
are also needed in the traits.alias section.

Doug



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: ArrayCollection Problem in AMFBinaryData.as

Piotr Zarzycki
Hi Doug,

We simply don't have ArrayCollection in Royale, that's why you are receiving such issue. Does changing to a simple array will cost you a lot ? If you receive from AMF simple array - you can get it in Royale and wrap up it to ArrayList in order to take advantage from Binding.

Piotr

2018-05-09 10:57 GMT+02:00 doug777 <[hidden email]>:
My RemoteObject returns a complex Object in part of which CF has specified
what looks to me like a simple array as an ArrayCollection in the returned
AMF Data. (Works ok in the old SWF project.)

Stepping through the code in the browser debugger, when the reader reaches
the n of ArrayCollection in reader.data, it immediately errors with the
message :

e : "Failed to deserialize: Failed to deserialize: Failed to deserialize:
ReferenceError: Class flex.messaging.io.ArrayCollection could not be found."

Looking into AMFBinaryData.as, I can see that the execution (after reading
in "ArrayCollection") follows the path to readScriptObject() at line 868 and
then goes to line 877.

Unfortunately traits.alias is true and it then fails when trying to get the
classAlias. It looks to me as though lines 894 - 898 or something like this
are also needed in the traits.alias section.

Doug



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/



--

Piotr Zarzycki 

Patreon: https://www.patreon.com/piotrzarzycki

Reply | Threaded
Open this post in threaded view
|

Re: ArrayCollection Problem in AMFBinaryData.as

Paul Hastings
If you're relying on ColdFusion for automatic serialization and you're converting queries you might look at your services-config.xml and turn this option off

serialize-array-to-arraycollection

Reply | Threaded
Open this post in threaded view
|

Re: ArrayCollection Problem in AMFBinaryData.as

doug777
In reply to this post by Piotr Zarzycki
Hi Piotr,

I can't change it. This is something CF does inside its serializer before
sending the data. The original data are just fields in a database converted
to a query by CF and then serialized by its internal converter.

The writer of AMFBinaryData was obviously aware of the problem as the
following code is included in AMFBinaryData.as :

if (obj[CLASS_ALIAS] == "flex.messaging.io.ArrayCollection"
                    || obj[CLASS_ALIAS] == "flex.messaging.io.ObjectProxy")
return this.readObject();

It's just that it's not in the path this object takes through the code.

Doug



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: ArrayCollection Problem in AMFBinaryData.as

doug777
In reply to this post by Paul Hastings
If you mean the setting in wwwroot/WEBINF/flex/services-config.xml  --

Sadly it is already set to false -


                                        <serialize-array-to-arraycollection>false
                                        </serialize-array-to-arraycollection>

But thanks for pointing out that there is a setting for this.

Doug



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: ArrayCollection Problem in AMFBinaryData.as

Paul Hastings
That's odd. What version of cf? All updated/hot fixed? Was the cf service restarted since that change was made?
 
Reply | Threaded
Open this post in threaded view
|

Re: ArrayCollection Problem in AMFBinaryData.as

Carlos Rovira-2
In reply to this post by doug777
Hi,

this is something we talked that would happen. I think we must to find a way to overcome it. Some options just think now:

1.- simply put ArrayCollection on place (although is becoming part of mx royale, I think this deserves to be isolated I some core library (maybe Collections)

2.- make something in RemoteObject that makes ArrayCollection become ArrayList

@Doug, if you could try this or other fix you think, you could make a pull request and I can look at it. Have you time to fix this and contribute to Apache Royale?

I think this is very important.

thanks!

Carlos



2018-05-09 11:41 GMT+02:00 doug777 <[hidden email]>:
If you mean the setting in wwwroot/WEBINF/flex/services-config.xml  --

Sadly it is already set to false -


                                        <serialize-array-to-arraycollection>false
                                        </serialize-array-to-arraycollection>

But thanks for pointing out that there is a setting for this.



--
Reply | Threaded
Open this post in threaded view
|

Re: ArrayCollection Problem in AMFBinaryData.as

doug777
In reply to this post by Paul Hastings
I'm using CF11 in developer mode locally and this setting has never been
changed since installation.

I'm wondering if this setting is applied only for high-level objects not
when CF is serializing a Query object since the object getting specified
here as an ArrayCollection is a very simple Array of Strings. It makes me
think that some very specific decision was made about how to recognize parts
of Query objects to allow for all eventualities in a simple way.

Even if this setting worked in Query objects, there is a further problem.
Both our test server and our client server use a shared ColdFusion so we
don't have access to the WEB-INF folder.

Doug



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: ArrayCollection Problem in AMFBinaryData.as

doug777
In reply to this post by Carlos Rovira-2
Hi Carlos,

Sure, I can take a look at this. Leave it with me.

Doug



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: ArrayCollection Problem in AMFBinaryData.as

Carlos Rovira-2
Thanks Doug!



2018-05-10 6:31 GMT+02:00 doug777 <[hidden email]>:
Hi Carlos,

Sure, I can take a look at this. Leave it with me.



--
Reply | Threaded
Open this post in threaded view
|

Re: ArrayCollection Problem in AMFBinaryData.as

doug777
Hi Carlos,

I now have ArrayCollection working properly. I suspect the same change will
also allow ObjectProxy to work properly as well, but at the moment I can't
test that.

Doug



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: ArrayCollection Problem in AMFBinaryData.as

Carlos Rovira-2
That's great Doug,

in other thread I told about passing collection from Java to Royale with success, but instead of use ArrayCollection I used ArrayList. 
That seems to work well. I still need to do more test. For example don't try to send ArrayList to Java. I think that could cause problems...

For you email what I understand is that you code ArrayCollection in royale?

thanks!


2018-05-17 4:18 GMT+02:00 doug777 <[hidden email]>:
Hi Carlos,

I now have ArrayCollection working properly. I suspect the same change will
also allow ObjectProxy to work properly as well, but at the moment I can't
test that.



--
Reply | Threaded
Open this post in threaded view
|

Re: ArrayCollection Problem in AMFBinaryData.as

doug777
Do you want to check the code? Do I need to make a pull request and choose
the AMF project or what?

Doug





--
Sent from: http://apache-royale-users.20374.n8.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: ArrayCollection Problem in AMFBinaryData.as

Carlos Rovira-2
If is an implementation of ArrayCollection, I think it should go to "Collections"
Then if AMF uses it, Network will need to use Collections.
To check all is working ok, I recommend you to pass maven so you can ensure the changes doesn't break things.

You can make a pull request and I'll look at it.

Thanks!

Carlos


2018-05-17 10:51 GMT+02:00 doug777 <[hidden email]>:
Do you want to check the code? Do I need to make a pull request and choose
the AMF project or what?



--
Reply | Threaded
Open this post in threaded view
|

Re: ArrayCollection Problem in AMFBinaryData.as

doug777
Sorry, you misunderstand me.

All I have done is allow AMFBinaryData to read ArrayCollection from CF
correctly.

I don't think there is any need for ArrayCollection in Royale. ArrayList is
perfectly adequate.

So all this is is a small change to AMFBinaryData.

Doug



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: ArrayCollection Problem in AMFBinaryData.as

Carlos Rovira-2
ok! perfect, 

so If there's only a change in AMFBinaryData, then you ensure you are up to latest changes in repo a create a PR with your changes so I can review it.

Thanks!

2018-05-17 11:03 GMT+02:00 doug777 <[hidden email]>:
Sorry, you misunderstand me.

All I have done is allow AMFBinaryData to read ArrayCollection from CF
correctly.

I don't think there is any need for ArrayCollection in Royale. ArrayList is
perfectly adequate.

So all this is is a small change to AMFBinaryData.



--
Reply | Threaded
Open this post in threaded view
|

Fork Question

Serkan Taş
Hi all,

I need some help for forking the royale-asjs repo.

I created the fork and added upstream info according to documentation. [1]
When trying to sync the fork [2] I get error at the step of branch chekout :

error: pathspec 'master' did not match any file(s) known to git.

I tried some investigation on the issue, but could not find resolution yet.

If any one may help it would shorten my research.

Thanks in advance
Serkan.

[1] https://help.github.com/articles/fork-a-repo/
[2] https://help.github.com/articles/syncing-a-fork/#platform-linux

--
Serkan Taş
Mobil : +90 532 250 07 71
Likya Bilgi Teknolojileri
ve İletişim Hiz. Ltd. Şti.
www.likyateknoloji.com

--------------------------------------
Bu elektronik posta ve onunla iletilen bütün dosyalar gizlidir. Sadece  
yukarıda isimleri belirtilen kişiler arasında özel haberleşme amacını  
taşımaktadır. Size yanlışlıkla ulaşmışsa bu elektonik postanın  
içeriğini açıklamanız, kopyalamanız, yönlendirmeniz ve kullanmanız  
kesinlikle yasaktır. Lütfen mesajı geri gönderiniz ve sisteminizden  
siliniz. Likya Bilgi Teknolojileri ve İletişim Hiz. Ltd. Şti. bu  
mesajın içeriği ile ilgili olarak hiç bir hukuksal sorumluluğu kabul  
etmez.

This electronic mail and any files transmitted with it are intended  
for the private use of  the persons named above. If you received this  
message in error, forwarding, copying or use of any of the information  
is strictly prohibited. Please immediately notify the sender and  
delete it from your system. Likya Bilgi Teknolojileri ve İletişim Hiz.  
Ltd. Şti. does not accept legal responsibility for the contents of  
this message.
--------------------------------------