hexiaofeng wrote:
> hi all
> But it seems some exception print when session send message to Flex.
>   
Exact.
> 2009-7-22 18:40:49 test.ServerChatProtocolHandler exceptionCaught
> 警告: Unexpected exception.
> java.lang.IllegalStateException: Don't know how to handle message of type 
> 'java.lang.String'.  Are you missing a protocol encoder?
>   
So, the question is : Are you missing a protocol encoder ? Obviously, yes.



> How to fix it? thank you very much
>   
Add a protocolEncoder in your chain :

chain.addLast("codec", new ProtocolCodecFilter(
new TextLineCodecFactory()));

MINA needs to know how to convert a String to a IoBuffer.

-- 
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org


Reply via email to