{"action":"opened","issue":{"url":"https://api.github.com/repos/alibaba/dubbo/issues/278","repository_url":"https://api.github.com/repos/alibaba/dubbo","labels_url":"https://api.github.com/repos/alibaba/dubbo/issues/278/labels{/name}","comments_url":"https://api.github.com/repos/alibaba/dubbo/issues/278/comments","events_url":"https://api.github.com/repos/alibaba/dubbo/issues/278/events","html_url":"https://github.com/alibaba/dubbo/issues/278","id":163792196,"number":278,"title":"接口的Map对象有有个字段值是new Object()，用hessian序列化就报错了","user":{"login":"wangjohnny","id":3859958,"avatar_url":"https://avatars.githubusercontent.com/u/3859958?v=3","gravatar_id":"","url":"https://api.github.com/users/wangjohnny","html_url":"https://github.com/wangjohnny","followers_url":"https://api.github.com/users/wangjohnny/followers","following_url":"https://api.github.com/users/wangjohnny/following{/other_user}","gists_url":"https://api.github.com/users/wangjohnny/gists{/gist_id}","starred_url":"https://api.github.com/users/wangjohnny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wangjohnny/subscriptions","organizations_url":"https://api.github.com/users/wangjohnny/orgs","repos_url":"https://api.github.com/users/wangjohnny/repos","events_url":"https://api.github.com/users/wangjohnny/events{/privacy}","received_events_url":"https://api.github.com/users/wangjohnny/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-07-05T07:59:07Z","updated_at":"2016-07-05T07:59:07Z","closed_at":null,"body":"dubbo版本：2.4.11\r\n返回类定义：\r\n`public class JsonMap extends HashMap<String, Object> {\r\n    private static final long serialVersionUID = 1L;\r\n\r\n    /** 通知消息 */\r\n    private static final String MESSAGE = \"message\";\r\n\r\n    /** 状态码 */\r\n    private static final String CODE = \"code\";\r\n\r\n    /** 数据 */\r\n    private static final String DATA = \"data\";\r\n\r\n    public static String ofJson(String code, String message, Object data, PropertyPreFilter... propertyPreFilters) {\r\n        JsonMap map = of(code, message, data);\r\n        return JSON.toJSONString(map, propertyPreFilters);\r\n    }\r\n\r\n    public static String ofJson(String code, Object data, PropertyPreFilter... propertyPreFilters) {\r\n        return ofJson(code, \"\", data, propertyPreFilters);\r\n    }\r\n\r\n    public static String ofJson(String code, String message, PropertyPreFilter... propertyPreFilters) {\r\n        return ofJson(code, message, new Object(), propertyPreFilters);\r\n    }\r\n\r\n    public static String ofJson(String code, PropertyPreFilter... propertyPreFilters) {\r\n        return ofJson(code, \"\", propertyPreFilters);\r\n    }\r\n\r\n    public static JsonMap of(boolean success, String message, Object data) {\r\n        return of(success ? \"2000\" : \"5000\", message, data);\r\n    }\r\n\r\n    public static JsonMap of(String code, String message, Object data) {\r\n        JsonMap map = new JsonMap();\r\n        map.setCode(code);\r\n        map.setMessage(message);\r\n        map.setData(data);\r\n        return map;\r\n    }\r\n\r\n    public static JsonMap of(boolean success, String message) {\r\n        return of(success, message, new Object());\r\n    }\r\n\r\n    public static JsonMap of(String code, String message) {\r\n        return of(code, message, new Object());\r\n    }\r\n\r\n    public static JsonMap of(boolean success) {\r\n        return of(success, \"\");\r\n    }\r\n\r\n    public static JsonMap of(String code) {\r\n        return of(code, \"\");\r\n    }\r\n\r\n    public JsonMap() {\r\n        super();\r\n        this.setCode(\"2000\");\r\n        this.setData(new Object());\r\n        this.setMessage(\"\");\r\n    }\r\n\r\n    public Object getData() {\r\n        return this.get(DATA);\r\n    }\r\n\r\n    public void setData(Object data) {\r\n        this.put(DATA, data);\r\n    }\r\n\r\n    public String getCode() {\r\n        Object code = this.get(CODE);\r\n        return code != null ? code.toString() : \"\";\r\n    }\r\n\r\n    public void setCode(String code) {\r\n        this.put(CODE, code);\r\n    }\r\n\r\n    public String getMessage() {\r\n        Object message = this.get(MESSAGE);\r\n        return message != null ? message.toString() : \"\";\r\n    }\r\n\r\n    public void setMessage(String message) {\r\n        this.put(MESSAGE, message);\r\n    }\r\n\r\n    public boolean isSuccess() {\r\n        return this.getCode().equals(\"2000\");\r\n    }\r\n}\r\n`\r\n业务方法：\r\n`\r\n    public JsonMap valid(String brokerSid) {\r\n        Broker broker = brokerService.selectByPrimaryKey(brokerSid);\r\n\r\n        if (!broker.getValid()) {\r\n            return JsonMap.of(false, \"错误信息\");\r\n        }\r\n\r\n        return JsonMap.of(true);\r\n    }\r\n`\r\n\r\ncom.alibaba.dubbo.remoting.RemotingException: Failed to send response: Response [id=310, version=2.0.0, status=20, event=false, error=null, result=RpcResult [result={code=2000, data=java.lang.Object@42e3fe0, message=}, exception=null]], cause: java.lang.RuntimeException: 13 class java.lang.Object\r\njava.lang.RuntimeException: 13 class java.lang.Object\r\n        at com.alibaba.com.caucho.hessian.io.BasicSerializer.writeObject(BasicSerializer.java:282)\r\n        at com.alibaba.com.caucho.hessian.io.Hessian2Output.writeObject(Hessian2Output.java:408)\r\n        at com.alibaba.com.caucho.hessian.io.MapSerializer.writeObject(MapSerializer.java:100)\r\n        at com.alibaba.com.caucho.hessian.io.Hessian2Output.writeObject(Hessian2Output.java:408)\r\n        at com.alibaba.dubbo.common.serialize.support.hessian.Hessian2ObjectOutput.writeObject(Hessian2ObjectOutput.java:92)\r\n        at com.alibaba.dubbo.rpc.protocol.dubbo.DubboCodec.encodeResponseData(DubboCodec.java:200)\r\n        at com.alibaba.dubbo.remoting.exchange.codec.ExchangeCodec.encodeResponse(ExchangeCodec.java:273)\r\n        at com.alibaba.dubbo.remoting.exchange.codec.ExchangeCodec.encode(ExchangeCodec.java:77)\r\n        at com.alibaba.dubbo.rpc.protocol.dubbo.DubboCountCodec.encode(DubboCountCodec.java:41)\r\n"}}
{"actor":{"display_login":"wangjohnny"}}