GitHub user colin0000007 created a discussion: Why did the consumer encounter
an org.apache.dubbo.remoting.RemotingException during serialization without any
logs or hints being printed—just throwing the exception directly to the
consumer?
### Pre-check
- [X] I am sure that all the content I provide is in English.
### Apache Dubbo Component
Java SDK (apache/dubbo)
### Details
Last week, i was troubleshooting a problem that the consumer encounter an
org.apache.dubbo.remoting.RemotingExceptionm, the error stack is below.
At first, i thought it was consumer's problem because there was no any error
log at provider. So i tried to adjust the JVM -XX:MaxDirectMemorySize
parameters for consumer, but it did not work. Finally I founded that the
exception comes from the provider. so Why did the consumer encounter an
org.apache.dubbo.remoting.RemotingException during serialization without any
logs or hints being printed—just throwing the exception directly to the
consumer? it was so confused and hard to find problems.
`org.apache.dubbo.remoting.RemotingException: Failed to send response: Response
[id=663789, version=2.0.2, status=20, event=false, error=null,
result=AppResponse [value=com.amap.xxx.common.service.Result@4531ec94,
exception=null]], cause: java.io.IOException:
org.apache.dubbo.common.serialize.SerializationException:
com.esotericsoftware.kryo.KryoException: Error writing requestId at position
4096
Serialization trace:
data (com.amap.xxx.common.service.Result)
java.io.IOException: org.apache.dubbo.common.serialize.SerializationException:
com.esotericsoftware.kryo.KryoException: Error writing requestId at position
4096
Serialization trace:
data (com.amap.xxx.common.service.Result)
at
org.apache.dubbo.common.serialize.DefaultSerializationExceptionWrapper.handleToIOException(DefaultSerializationExceptionWrapper.java:358)
at
org.apache.dubbo.common.serialize.DefaultSerializationExceptionWrapper.access$000(DefaultSerializationExceptionWrapper.java:28)
at
org.apache.dubbo.common.serialize.DefaultSerializationExceptionWrapper$ProxyObjectOutput.writeObject(DefaultSerializationExceptionWrapper.java:324)
at
org.apache.dubbo.rpc.protocol.dubbo.DubboCodec.encodeResponseData(DubboCodec.java:289)
at
org.apache.dubbo.remoting.exchange.codec.ExchangeCodec.encodeResponse(ExchangeCodec.java:325)
at
org.apache.dubbo.remoting.exchange.codec.ExchangeCodec.encode(ExchangeCodec.java:81)
at
org.apache.dubbo.rpc.protocol.dubbo.DubboCountCodec.encode(DubboCountCodec.java:51)
at
org.apache.dubbo.remoting.transport.netty4.NettyChannel.send(NettyChannel.java:192)
at
org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeChannel.send(HeaderExchangeChannel.java:107)
at
org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeChannel.send(HeaderExchangeChannel.java:96)
at
org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.lambda$handleRequest$0(HeaderExchangeHandler.java:120)
at
java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:774)
at
java.util.concurrent.CompletableFuture.uniWhenCompleteStage(CompletableFuture.java:792)
at
java.util.concurrent.CompletableFuture.whenComplete(CompletableFuture.java:2153)
at
java.util.concurrent.CompletableFuture.whenComplete(CompletableFuture.java:110)
at
org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.handleRequest(HeaderExchangeHandler.java:111)
at
org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:200)
at
org.apache.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:53)
at
org.apache.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:62)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at
org.apache.dubbo.common.threadlocal.InternalRunnable.run(InternalRunnable.java:41)
at java.lang.Thread.run(Thread.java:750)
Caused by: org.apache.dubbo.common.serialize.SerializationException:
com.esotericsoftware.kryo.KryoException: Error writing requestId at position
4096
Serialization trace:
data (com.amap.xxx.common.service.Result)
... 23 more
Caused by: com.esotericsoftware.kryo.KryoException: Error writing requestId at
position 4096
Serialization trace:
data (com.amap.xxx.common.service.Result)
at
com.esotericsoftware.kryo.serializers.FieldSerializer.write(FieldSerializer.java:112)
at com.esotericsoftware.kryo.Kryo.writeObject(Kryo.java:642)
at
com.esotericsoftware.kryo.serializers.CollectionSerializer.write(CollectionSerializer.java:155)
at
com.esotericsoftware.kryo.serializers.CollectionSerializer.write(CollectionSerializer.java:44)
at com.esotericsoftware.kryo.Kryo.writeObject(Kryo.java:642)
at
com.esotericsoftware.kryo.serializers.ReflectField.write(ReflectField.java:71)
at
com.esotericsoftware.kryo.serializers.FieldSerializer.write(FieldSerializer.java:108)
at com.esotericsoftware.kryo.Kryo.writeClassAndObject(Kryo.java:711)
at
org.apache.dubbo.common.serialize.DefaultSerializationExceptionWrapper$ProxyObjectOutput.writeObject(DefaultSerializationExceptionWrapper.java:322)
... 20 more
**Caused by: io.netty.util.internal.OutOfDirectMemoryError: failed to allocate
16777216 byte(s) of direct memory (used: 1073741824, max: 1073741824)**
at
io.netty.util.internal.PlatformDependent.incrementMemoryCounter(PlatformDependent.java:802)`
### Code of Conduct
- [X] I agree to follow this project's [Code of
Conduct](https://www.apache.org/foundation/policies/conduct)
GitHub link: https://github.com/apache/dubbo/discussions/15797
----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]