dubbo调用服务出现如下异常Serialized class com.taotao.manager.pojo.TaoResult must implement java.io.Serializabl

20880-thread-4] [com.alibaba.dubbo.remoting.exchange.codec.ExchangeCodec]-[WARN]  [DUBBO] Fail to encode response: Response [id=2, version=2.0.0, status=20, event=false, error=null, result=RpcResult [result=com.taotao.manager.pojo.TaoResult@1e6db3f, exception=null]], send bad_response info instead, cause: Serialized class com.taotao.manager.pojo.TaoResult must implement java.io.Serializable, dubbo version: 2.5.3, current host: 127.0.0.1



解决方案:使用Dubbo进行数据传递时,需让作为消息传递的类序列化。




public class TaoResult implements Serializable{
	
	private long total;
	private List rows;
	public long getTotal() {
		return total;
	}
	public void setTotal(long total) {
		this.total = total;
	}
	public List getRows() {
		return rows;
	}
	public void setRows(List rows) {
		this.rows = rows;
	}
	
}


你可能感兴趣的:(【java框架】,dubbo,ssm,Serializable)