4

I have encountered the following exception:

[BlazeDS] Unsupported AMF version 4,660. 
flex.messaging.MessageException: Unsupported AMF version 4,660. 
at flex.messaging.io.amf.AmfMessageDeserializer.readMessage(AmfMessageDeserializer.java:93) 
at flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java:114) 
at flex.messaging.endpoints.BaseHTTPEndpoint.service(BaseHTTPEndpoint.java:274) 
at flex.messaging.MessageBrokerServlet.service(MessageBrokerServlet.java:377) 

I'm on version 3.0.0.544 of BlazeDS, and although I found multiple posts talking about upgrading to version 3.2 in order to resolve a similar issue, I don't think that this is the correct fix for my problem. The posts I found talk about seeing unsupported version 1. When I looked at the fix put into version 3.2 of BlazeDS it looks like version 1 is converted to 0 (AMF1 to AMF0). Exception seen above is thrown for any other versions beside 0, 1 and 3 (AMF0, AMF1 and AMF3 respectively).

Does anybody know what could be causing this exception? (And I did not mean that BlazeDS throws an exception, I get that.) What I'm asking is why is the version 4660 and not 0 or 3.

1 Answers1

1

Did you checkout the latest version of Blazeds from source-control?

I had a look into the code and to me it looks like a bug in their code. Have a look further down and look for LOOK_HERE. That condition to me looks like impossible? Why don't you download this code and add it to your project, comment out that condition and see what happens.

The below code is from AmfMessageDeserializer.java.

int version = amfIn.readUnsignedShort();

        // Treat FMS's AMF1 as AMF0.
        if (version == MessageIOConstants.AMF1)
            version = MessageIOConstants.AMF0; 

// <LOOK_HERE>
if (version != MessageIOConstants.AMF0 && version != MessageIOConstants.AMF3)
        {
            //Unsupported AMF version {version}.
            MessageException ex = new MessageException();
            ex.setMessage(UNSUPPORTED_AMF_VERSION, new Object[] {new Integer(version)});
            ex.setCode(CODE_VERSION_MISMATCH);
            throw ex;
        }
avijendr
  • 3,958
  • 2
  • 31
  • 46
  • You didn't answer my question. I understand that an exception is thrown. My question is not where an exception is coming from but why the AMF version is what it is. Any ideas? I was thinking that this is some kind of a frame shift during sending of data over the network. – Paul A. Trzyna Feb 03 '14 at 20:59