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.IMes sage.
at PollCommandMessageResponde r/resultHa ndler()
at mx.messaging::MessageRespo nder/resul t()
I believe that all the relevant classes have been imported, and registered as follows:
registerClassAlias( "flex.messaging.messages.E rrorMessag e", ErrorMessage );
registerClassAlias( "flex.messaging.messages.C ommandMess age", CommandMessage );
registerClassAlias( "flex.messaging.messages.R emotingMes sage", RemotingMessage );
registerClassAlias( "flex.messaging.messages.A cknowledge Message ", AcknowledgeMessage );
registerClassAlias( "DSC", CommandMessageExt );
registerClassAlias( "DSK", AcknowledgeMessageExt );
registerClassAlias( "flex.messaging.config.Con figMap", ConfigMap );
registerClassAlias( "flex.messaging.io.ArrayCo llection", ArrayCollection );
registerClassAlias( "flex.messaging.io.ObjectP roxy", ObjectProxy );
registerClassAlias( "mx.messaging.messages.IMe ssage", 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
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.IMes
at PollCommandMessageResponde
at mx.messaging::MessageRespo
I believe that all the relevant classes have been imported, and registered as follows:
registerClassAlias( "flex.messaging.messages.E
registerClassAlias( "flex.messaging.messages.C
registerClassAlias( "flex.messaging.messages.R
registerClassAlias( "flex.messaging.messages.A
registerClassAlias( "DSC", CommandMessageExt );
registerClassAlias( "DSK", AcknowledgeMessageExt );
registerClassAlias( "flex.messaging.config.Con
registerClassAlias( "flex.messaging.io.ArrayCo
registerClassAlias( "flex.messaging.io.ObjectP
registerClassAlias( "mx.messaging.messages.IMe
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.