1 Reply Latest reply on May 15, 2008 12:18 PM by EdLaFave

    Error #2004: One of the parameters is invalid

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


      var remoteObject:RemoteObject = new RemoteObject();
      remoteObject.destination = "someDestination";
      remoteObject.addEventListener(ResultEvent.RESULT, resultHandler, false, 0, true);

      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:


      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:



      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. Re: Error #2004: One of the parameters is invalid
          EdLaFave 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.