You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by il...@apache.org on 2019/07/11 02:33:38 UTC
[dubbo] branch 2.6.x updated: Dubbo throws exception when use java
serializer (#4530)
This is an automated email from the ASF dual-hosted git repository.
iluo pushed a commit to branch 2.6.x
in repository https://gitbox.apache.org/repos/asf/dubbo.git
The following commit(s) were added to refs/heads/2.6.x by this push:
new 0e886a9 Dubbo throws exception when use java serializer (#4530)
0e886a9 is described below
commit 0e886a966cec1dfd1f8f9308e76b4d99583bd654
Author: 祁晓波 <qi...@gmail.com>
AuthorDate: Thu Jul 11 10:33:17 2019 +0800
Dubbo throws exception when use java serializer (#4530)
* Dubbo throws exception when use java serializer
issues:
https://github.com/apache/dubbo/issues/3951
https://github.com/apache/dubbo/issues/3698
* Dubbo throws exception when use java serializer
issues:
https://github.com/apache/dubbo/issues/3951
https://github.com/apache/dubbo/issues/3698
fix travis-ci
UnusedImports
---
.../com/alibaba/dubbo/rpc/protocol/dubbo/DubboCodec.java | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/com/alibaba/dubbo/rpc/protocol/dubbo/DubboCodec.java b/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/com/alibaba/dubbo/rpc/protocol/dubbo/DubboCodec.java
index b159191..3c12448 100644
--- a/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/com/alibaba/dubbo/rpc/protocol/dubbo/DubboCodec.java
+++ b/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/com/alibaba/dubbo/rpc/protocol/dubbo/DubboCodec.java
@@ -22,7 +22,6 @@ import com.alibaba.dubbo.common.io.Bytes;
import com.alibaba.dubbo.common.io.UnsafeByteArrayInputStream;
import com.alibaba.dubbo.common.logger.Logger;
import com.alibaba.dubbo.common.logger.LoggerFactory;
-import com.alibaba.dubbo.common.serialize.ObjectInput;
import com.alibaba.dubbo.common.serialize.ObjectOutput;
import com.alibaba.dubbo.common.utils.ReflectUtils;
import com.alibaba.dubbo.common.utils.StringUtils;
@@ -73,13 +72,12 @@ public class DubboCodec extends ExchangeCodec implements Codec2 {
byte status = header[3];
res.setStatus(status);
try {
- ObjectInput in = CodecSupport.deserialize(channel.getUrl(), is, proto);
if (status == Response.OK) {
Object data;
if (res.isHeartbeat()) {
- data = decodeHeartbeatData(channel, in);
+ data = decodeHeartbeatData(channel, CodecSupport.deserialize(channel.getUrl(), is, proto));
} else if (res.isEvent()) {
- data = decodeEventData(channel, in);
+ data = decodeEventData(channel, CodecSupport.deserialize(channel.getUrl(), is, proto));
} else {
DecodeableRpcResult result;
if (channel.getUrl().getParameter(
@@ -97,7 +95,7 @@ public class DubboCodec extends ExchangeCodec implements Codec2 {
}
res.setResult(data);
} else {
- res.setErrorMessage(in.readUTF());
+ res.setErrorMessage(CodecSupport.deserialize(channel.getUrl(), is, proto).readUTF());
}
} catch (Throwable t) {
if (log.isWarnEnabled()) {
@@ -117,11 +115,10 @@ public class DubboCodec extends ExchangeCodec implements Codec2 {
}
try {
Object data;
- ObjectInput in = CodecSupport.deserialize(channel.getUrl(), is, proto);
if (req.isHeartbeat()) {
- data = decodeHeartbeatData(channel, in);
+ data = decodeHeartbeatData(channel, CodecSupport.deserialize(channel.getUrl(), is, proto));
} else if (req.isEvent()) {
- data = decodeEventData(channel, in);
+ data = decodeEventData(channel, CodecSupport.deserialize(channel.getUrl(), is, proto));
} else {
DecodeableRpcInvocation inv;
if (channel.getUrl().getParameter(