Skip to content


Server. Acknowledge. Failed.

DO NOT send undefined complex datatypes (seems only relevant to Arrays, actually, but not 100% certain) to a remote method when using BlazeDS to manage your client/server communication.

I mentioned in a recent post that we suddenly started getting this non-helpful message when calling a method that we have been calling for about eight months.

This is a message you can get when using BlazeDS (maybe LCDS, as well?), and it basically means that there is a communication problem between the client and BlazeDS. At least that’s what I think it means based on the evidence in front of me.

Evidence

  1. We’ve been using this method for quite awhile. However, something about it changed, which set off this issue. The method was modified to accept a new object – let’s call it ‘A’, which contained a few simple properties and an array of objects (the datatype of which was also new – let’s call it ‘B’).
  2. Using an http proxy debugger, of some sort, I can see that the data makes it to the server, and the server returns a correct response. The server also explicitly states that there were no errors. Obviously, this doesn’t necessarily mean that no errors occured, but since the correct and expected response is returned, it sure looks like there weren’t any. Even though the error message begins with ‘Server’.

I found virtually nothing helpful online (it’s not you, Google, it’s me), except for this, which is currently one of my top five favorite blog post titles:

http://ria-coder.com/blog/serveracknowledgefailed-another-amfphp-ballache/

After a LOT of crying, and some debugging, I finally found/realized that the ‘logic’ I had written was creating an undefined value in Object A for the array of Object B elements.

I won’t get into what I did to accomplish this, but it was pretty dumb.

The point is that, just like my friend with the AMFPHP-flavored ballache, I was sending an undefined complex datatype across BlazeDS. Note that this is not the same thing as sending an empty or null value – the array was undefined (as in declared, but never given a value).

I would have realized this obvious yet invisible mistake about a thousand years earlier if ActionScript didn’t fail silently if you attempt to push items into declared-but-undefined array. Hm, that one’s going in my list of things that bother me about ActionScript.

Posted in Ouch.


0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.