Link to home
Start Free TrialLog in
Avatar of anotherfn
anotherfn

asked on

TypeError: Error #1034: Type Coercion failed

We are creating a project using ActionScript 3 and Server-side Java through BlazeDS.  At the moment, we are trying to remotely call a function from the client on the server, which will then send a message back to all clients.

However, when this is run, the remote call goes through correctly, but when the server is trying to send the message back, we are getting this run-time error in ActionScript:

TypeError: Error #1034: Type Coercion failed: cannot convert Object@251d651 to mx.messaging.messages.IMessage.
 at PollCommandMessageResponder/resultHandler()
 at mx.messaging::MessageResponder/result()

I believe that all the relevant classes have been imported, and registered as follows:

registerClassAlias( "flex.messaging.messages.ErrorMessage", ErrorMessage );
   registerClassAlias( "flex.messaging.messages.CommandMessage", CommandMessage );
   registerClassAlias( "flex.messaging.messages.RemotingMessage", RemotingMessage );
   registerClassAlias( "flex.messaging.messages.AcknowledgeMessage ", AcknowledgeMessage );
   registerClassAlias( "DSC", CommandMessageExt );
   registerClassAlias( "DSK", AcknowledgeMessageExt );
   registerClassAlias( "flex.messaging.config.ConfigMap", ConfigMap );
   registerClassAlias( "flex.messaging.io.ArrayCollection", ArrayCollection );
   registerClassAlias( "flex.messaging.io.ObjectProxy", ObjectProxy );
   registerClassAlias( "mx.messaging.messages.IMessage", IMessage);

We know that there is a type conflict, but are unsure why it is occuring, as messaging between clients works, as does remoting.  As such, we are unsure how to progress any further with the project
ASKER CERTIFIED SOLUTION
Avatar of dgofman
dgofman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial