Array of numbers to Array of java primitives
Ethan Sutin <[email protected]>
| Newsgroups | gmane.comp.java.openamf.user |
|---|---|
| Message-ID | <[email protected]> |
hello!
I'm having troubles. I'm attempting to send a object which contains an
Array. This array contains numbers. The java object it is mapped to
expects an a list of primitive longs. This results in a class cast
exception.
what is the best way to do this? any suggestions would be greatly
appreciated!
I also came across this post :
http://www.flashant.org/index.php?m=200401
11.01.04
The Trouble With Doubles [OpenAMF]
<http://www.flashant.org/index.php?cat=19> - lindsay @ 13:17:04
<http://www.flashant.org/index.php?m=200401#28>
Thanks, Aral. It's my pleasure to help the RIA developer community.
Yes, I came across two issues. One was with the migration from MM Flash
Remoting to OpenAMF. With MM Flash Remoting, some arrays of numbers were
passed as Doubles, where with OpenAMF they were Integers. The second
issue had to do with the version of OpenAMF.
With the Java type of numbers passed via OpenAMF, diagnosis of this
issue was a little tricky. The error manifested itself as what appeared
to be a Tomcat connection issue, but it became very obvious when I saw a
logged ClassCastException error. The fix was trivial in this application
as we only deal with what are effectively Integers, but there are some
implications. I hope that OpenAMF isn't trying to intelligently type the
numbers that come down the wire (unlikely, but what happens when Flash
passes a double or a float?).
The other issue is with the version of OpenAMF, currently 0.9 works but
any later version doesn't (in our particular application). I haven't
looked into it in any detail but I'll post more about this when I have it.
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/