BlazeDS error: Unsupported AMF version 17,491
Doing some Flex development today using BlazeDS for the Java side, I came
across a problem where the server raised an exception Unsupported AMF version
17,491
. Googling did not provide a solution, but other people have had the
same problem. While I can’t say for certain how this might affect other users,
in my case it was entirely self-inflicted. I was trying out different
combinations of channels for connecting the client to the server, and at one
point I changed the end-point of the AMF channel without changing the handler
class. In my Services.mxml
I had:
<cairngorm:ServiceLocator
xmlns:cairngorm="http://www.adobe.com/2006/cairngorm"
xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:RemoteObject
id="commandDispatcher"
destination="CommandDispatcher"
showBusyCursor="false">
<mx:channelSet>
<mx:ChannelSet>
<mx:channels>
<mx:AMFChannel
url="http://localhost:8080/iserver/messagebroker/amf"/>
</mx:channels>
</mx:ChannelSet>
</mx:channelSet>
</mx:RemoteObject>
</cairngorm:ServiceLocator>
At one point, I was using the streaming channel instead:
<mx:StreamingAMFChannel
url="http://localhost:8080/iserver/messagebroker/streamingamf"/>
The problem above arose when I accidentally put my code into an inconsistent state:
<mx:StreamingAMFChannel
url="http://localhost:8080/iserver/messagebroker/amf"/>
The URL points to the non-streaming channel, but the wrapper class is
StreamingAMFChannel
. Moral: don’t do that.