Mina出现问题:Don't know how to handle message of type 'java.lang.String'
Mina在做心跳实验时,客户端出现java.lang.IllegalStateException: Don't know how to handle message of type 'java.lang.String'. Are you missing a protocol encoder? 帖子 https://blog.csdn.net/xiaoborui20110806/article/details/41075075 中说mina不知道如何处理string,要在connector增加一个ProtocolCodecFilter,我的客户端源代码: public class KeepAliveMessageFactoryImpl implements KeepAliveMessageFactory { Logger logger = LoggerFactory.getLogger(this.getClass()); /** 心跳包内容 刚好和服务器相反*/ private static final String CLIENTHEARTBEATREQUEST = "1112";//客户端发 private static final String CLIENTHEARTBEATRESPONSE = "1111";//客户端收的服务端信息 // 原文链接:https://blog