当前仓库属于关闭状态,部分功能使用受限,详情请查阅 仓库状态说明
885 Star 7.7K Fork 3.8K

GVPssssssss-team / spider-flow
关闭

 / 详情

循环下载的时候报这个错误:Premature EOF

待办的
创建于  
2023-01-31 13:46
Caused by: org.spiderflow.core.expression.ExpressionError$TemplateException: Error (1): Couldn't call method 'getBytes' with arguments '[]' on object of type 'HttpResponse'.

	at org.spiderflow.core.expression.ExpressionError.error(ExpressionError.java:53)
	at org.spiderflow.core.expression.parsing.Ast$MethodCall.evaluate(Ast.java:1203)
	at org.spiderflow.core.expression.parsing.Ast$MemberAccess.evaluate(Ast.java:951)
	... 25 common frames omitted
Caused by: java.lang.RuntimeException: Couldn't call method 'getBytes' with arguments '[]' on object of type 'HttpResponse'.
	at org.spiderflow.core.expression.interpreter.JavaReflection.callMethod(JavaReflection.java:327)
	at org.spiderflow.core.expression.parsing.Ast$MethodCall.evaluate(Ast.java:1201)
	... 26 common frames omitted
Caused by: java.lang.reflect.InvocationTargetException: null
	at sun.reflect.GeneratedMethodAccessor59.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.spiderflow.core.expression.interpreter.JavaReflection.callMethod(JavaReflection.java:324)
	... 27 common frames omitted
Caused by: java.lang.RuntimeException: org.jsoup.UncheckedIOException: java.io.IOException: Premature EOF
	at org.spiderflow.core.io.HttpResponse.getBytes(HttpResponse.java:85)
	... 31 common frames omitted
Caused by: org.jsoup.UncheckedIOException: java.io.IOException: Premature EOF
	at org.jsoup.helper.HttpConnection$Response.prepareByteData(HttpConnection.java:977)
	at org.jsoup.helper.HttpConnection$Response.bodyAsBytes(HttpConnection.java:996)
	at org.spiderflow.core.io.HttpResponse.getBytes(HttpResponse.java:83)
	... 31 common frames omitted
Caused by: java.io.IOException: Premature EOF
	at sun.net.www.http.ChunkedInputStream.readAheadBlocking(ChunkedInputStream.java:565)
	at sun.net.www.http.ChunkedInputStream.readAhead(ChunkedInputStream.java:609)
	at sun.net.www.http.ChunkedInputStream.read(ChunkedInputStream.java:696)
	at java.io.FilterInputStream.read(FilterInputStream.java:133)
	at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:3468)
	at java.io.BufferedInputStream.read1(BufferedInputStream.java:284)
	at java.io.BufferedInputStream.read(BufferedInputStream.java:345)
	at org.jsoup.internal.ConstrainableInputStream.read(ConstrainableInputStream.java:64)
	at org.jsoup.internal.ConstrainableInputStream.readToByteBuffer(ConstrainableInputStream.java:86)
	at org.jsoup.helper.DataUtil.readToByteBuffer(DataUtil.java:252)
	at org.jsoup.helper.HttpConnection$Response.prepareByteData(HttpConnection.java:975)
	... 33 common frames omitted

评论 (1)

Coding365 创建了任务

暂时解决办法把这个代码注释掉

	this.connection.ignoreContentType(true);
		this.connection.ignoreHttpErrors(true);
	//	this.connection.maxBodySize(0);
		Response response = connection.execute();

登录 后才可以发表评论

状态
负责人
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
参与者(1)
1139094 io123 1578941772
Java
1
https://gitee.com/ssssssss-team/spider-flow.git
git@gitee.com:ssssssss-team/spider-flow.git
ssssssss-team
spider-flow
spider-flow

搜索帮助