gpt4 book ai didi

java.io.IOException :Bogus chunk size 异常

转载 作者:可可西里 更新时间:2023-11-01 16:31:04 25 4
gpt4 key购买 nike

Can any one tell me why the Bogus chunk size error occurs.

Exception at the swingToSvlt method:java.io.IOException:Bogus chunk size//->java.io.IOException: Bogus chunk size at sun.net.www.http.ChunkedInputStream.processRaw(Unknown Source)>>at sun.net.www.http.ChunkedInputStream.readAheadBlocking(Unknown Source)>>at sun.net.www.http.ChunkedInputStream.readAhead(Unknown Source)>>at sun.net.www.http.ChunkedInputStream.read(Unknown Source)>>at java.io.FilterInputStream.read(Unknown Source)>>at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(Unknown Source)>>at java.io.ObjectInputStream$PeekInputStream.read(Unknown Source)>>at java.io.ObjectInputStream$PeekInputStream.readFully(Unknown Source)>>at java.io.ObjectInputStream$BlockDataInputStream.readUTFBody(Unknown Source)>>at java.io.ObjectInputStream$BlockDataInputStream.readUTF(Unknown Source)>>at java.io.ObjectInputStream.readString(Unknown Source)>>at java.io.ObjectInputStream.readObject0(Unknown Source)>>at java.io.ObjectInputStream.defaultReadFields(Unknown Source)>>at java.io.ObjectInputStream.readSerialData(Unknown Source)>>at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)>>at java.io.ObjectInputStream.readObject0(Unknown Source)>>at java.io.ObjectInputStream.readObject(Unknown Source)>>at java.util.ArrayList.readObject(Unknown Source)>>at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)>>at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)>>at java.lang.reflect.Method.invoke(Unknown Source)>>at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)>>at java.io.ObjectInputStream.readSerialData(Unknown Source)>>at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)>>at java.io.ObjectInputStream.readObject0(Unknown Source)>>at java.io.ObjectInputStream.readObject(Unknown Source)>>at java.util.Hashtable.readObject(Unknown Source)>>at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)>>at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)>>at java.lang.reflect.Method.invoke(Unknown Source)>>at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)>>at java.io.ObjectInputStream.readSerialData(Unknown Source)>>at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)>>at java.io.ObjectInputStream.readObject0(Unknown Source)>>at java.io.ObjectInputStream.readObject(Unknown Source)

最佳答案

来自代码ChunkedInputStream#processRaw ,第 306 行,我们有:

/*
* Extract the chunk size from the header (ignoring extensions).
*/
String header = new String(rawData, rawPos, pos-rawPos+1, "US-ASCII");
for (i=0; i < header.length(); i++) {
if (Character.digit(header.charAt(i), 16) == -1)
break;
}
try {
chunkSize = Integer.parseInt(header.substring(0, i), 16);
} catch (NumberFormatException e) {
error = true;
throw new IOException("Bogus chunk size");
}

看起来服务器正在发送不正确的 header ,我会确切地看到正在发送的内容,然后开始在那里找到问题。

关于java.io.IOException :Bogus chunk size 异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8090817/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com