- Dubbo version: 3.2.5
- Java version: 11,17
- fastjson2 2.0.39 list 在 一万多条 list 直接用 JSON.toJSONString ,打印正常 在 java 8 环境下,正常 在 java 11,17 会出现异常
java.io.IOException: org.apache.dubbo.common.serialize.SerializationException: java.lang.ArrayIndexOutOfBoundsException: arraycopy: last destination index 1594332 out of bounds for byte[1594323] at org.apache.dubbo.common.serialize.DefaultSerializationExceptionWrapper.handleToIOException(DefaultSerializationExceptionWrapper.java:358) ~[dubbo-3.2.5.jar:3.2.5] at org.apache.dubbo.common.serialize.DefaultSerializationExceptionWrapper.access$000(DefaultSerializationExceptionWrapper.java:28) ~[dubbo-3.2.5.jar:3.2.5] at org.apache.dubbo.common.serialize.DefaultSerializationExceptionWrapper$ProxyObjectOutput.writeObject(DefaultSerializationExceptionWrapper.java:324) ~[dubbo-3.2.5.jar:3.2.5] at org.apache.dubbo.rpc.protocol.dubbo.DubboCodec.encodeResponseData(DubboCodec.java:306) ~[dubbo-3.2.5.jar:3.2.5] at org.apache.dubbo.remoting.exchange.codec.ExchangeCodec.encodeResponse(ExchangeCodec.java:325) ~[dubbo-3.2.5.jar:3.2.5] at org.apache.dubbo.remoting.exchange.codec.ExchangeCodec.encode(ExchangeCodec.java:81) ~[dubbo-3.2.5.jar:3.2.5] at org.apache.dubbo.rpc.protocol.dubbo.DubboCountCodec.encode(DubboCountCodec.java:51) ~[dubbo-3.2.5.jar:3.2.5] at org.apache.dubbo.remoting.transport.netty4.NettyChannel.send(NettyChannel.java:192) ~[dubbo-3.2.5.jar:3.2.5] at org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeChannel.send(HeaderExchangeChannel.java:107) ~[dubbo-3.2.5.jar:3.2.5] at org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeChannel.send(HeaderExchangeChannel.java:96) ~[dubbo-3.2.5.jar:3.2.5] at org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.lambda$handleRequest$0(HeaderExchangeHandler.java:120) ~[dubbo-3.2.5.jar:3.2.5] at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:863) ~[na:na] at java.base/java.util.concurrent.CompletableFuture.uniWhenCompleteStage(CompletableFuture.java:887) ~[na:na] at java.base/java.util.concurrent.CompletableFuture.whenComplete(CompletableFuture.java:2325) ~[na:na] at java.base/java.util.concurrent.CompletableFuture.whenComplete(CompletableFuture.java:144) ~[na:na] at org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.handleRequest(HeaderExchangeHandler.java:111) ~[dubbo-3.2.5.jar:3.2.5] at org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:200) ~[dubbo-3.2.5.jar:3.2.5] at org.apache.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:53) ~[dubbo-3.2.5.jar:3.2.5] at org.apache.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:62) ~[dubbo-3.2.5.jar:3.2.5] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[na:na] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[na:na] at org.apache.dubbo.common.threadlocal.InternalRunnable.run(InternalRunnable.java:41) ~[dubbo-3.2.5.jar:3.2.5] at java.base/java.lang.Thread.run(Thread.java:833) ~[na:na] Caused by: org.apache.dubbo.common.serialize.SerializationException: java.lang.ArrayIndexOutOfBoundsException: arraycopy: last destination index 1594332 out of bounds for byte[1594323] ... 23 common frames omitted Caused by: java.lang.ArrayIndexOutOfBoundsException: arraycopy: last destination index 1594332 out of bounds for byte[1594323] at java.base/java.lang.System.arraycopy(Native Method) ~[na:na] at com.alibaba.fastjson2.JSONWriterJSONB.writeString(JSONWriterJSONB.java:695) ~[fastjson2-2.0.39.jar:na] at com.alibaba.fastjson2.writer.OWG_12_45_DriverDTO.writeJSONB(Unknown Source) ~[na:na] at com.alibaba.fastjson2.writer.ObjectWriterImplList.writeJSONB(ObjectWriterImplList.java:230) ~[fastjson2-2.0.39.jar:na] at com.alibaba.fastjson2.JSONB.toBytes(JSONB.java:1225) ~[fastjson2-2.0.39.jar:na] at org.apache.dubbo.common.serialize.fastjson2.FastJson2ObjectOutput.writeObject(FastJson2ObjectOutput.java:106) ~[dubbo-3.2.5.jar:3.2.5] at org.apache.dubbo.common.serialize.DefaultSerializationExceptionWrapper$ProxyObjectOutput.writeObject(DefaultSerializationExceptionWrapper.java:322) ~[dubbo-3.2.5.jar:3.2.5] ... 20 common frames omitted