Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Error #2004: One of the parameters is invalid

Avatar

Level 1
I'm trying to send an object from Java to Flex using BlazeDS
and the following code:




quote:



var remoteObject:RemoteObject = new RemoteObject();

remoteObject.destination = "someDestination";

remoteObject.addEventListener(ResultEvent.RESULT,
resultHandler, false, 0, true);

remoteCommandObject.someMethod();





The remote method is invoked and returns an object that
results in the following error "ArgumentError: Error #2004: One of
the parameters is invalid." I've read that you must reference the
class the remote call is returning so just to be safe I added the
following code to the class making the remote call:




quote:



private static const classCausingError:ClassCausingError =
null;





I've also read that the action script version of the class
that is being sent from Java to Flex must have the appropriate meta
data so I've added this to the action script class:




quote:



[RemoteClass(alias="some.path.ClassCausingError")]





I've tried to generalize the problem as much as possible, if
anybody wants to see the actual code then I will post it. Does
anybody have any suggestions about why this error is occurring and
how to fix it?
1 Reply

Avatar

Level 1
Figured it out! The java class implemented Externalizable
(for no good reason) but the flex class didn't implement
IExternalizable. Getting rid of the Externalizable implementation
on the java side corrected the problem. These classes have been in
use for months but were always serialized from Flex to Java, I
guess you have to go in the reverse direction to cause the
error.