gpt4 book ai didi

java - jclouds IOExpectation : Error writing request body to server

转载 作者:行者123 更新时间:2023-11-30 08:03:55 27 4
gpt4 key购买 nike

我们将jcloudsRackspace结合使用,并通过cloudfile api上传大量文件(多线程)

有一次,我们在 objectApi.put 行上遇到异常(请参阅底部的示例代码)

异常

16-Jul-2015 11:58:00.811 SEVERE [threadsPool-1]      org.jclouds.logging.jdk.JDKLogger.logError error after writing 8192/streaming bytes to https://*****/****.jpg
java.io.IOException: Error writing request body to server
at sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.checkError(HttpURLConnection.java:3478)
at sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.write(HttpURLConnection.java:3461)
at com.google.common.io.CountingOutputStream.write(CountingOutputStream.java:53)
at com.google.common.io.ByteStreams.copy(ByteStreams.java:74)
at org.jclouds.http.internal.JavaUrlHttpCommandExecutorService.writePayloadToConnection(JavaUrlHttpCommandExecutorService.java:297)
at org.jclouds.http.internal.JavaUrlHttpCommandExecutorService.convert(JavaUrlHttpCommandExecutorService.java:160)
at org.jclouds.http.internal.JavaUrlHttpCommandExecutorService.convert(JavaUrlHttpCommandExecutorService.java:64)
at org.jclouds.http.internal.BaseHttpCommandExecutorService.invoke(BaseHttpCommandExecutorService.java:91)
at org.jclouds.rest.internal.InvokeHttpMethod.invoke(InvokeHttpMethod.java:90)
at org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:73)
at org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:44)
at org.jclouds.reflect.FunctionalReflection$FunctionalInvocationHandler.handleInvocation(FunctionalReflection.java:117)
at com.google.common.reflect.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:87)
at com.sun.proxy.$Proxy176.put(Unknown Source)
at

S3 类似的问题

can be found here

示例代码

ObjectApi objectApi = cloudFiles.getObjectApi(REGION, container);
ByteSource byteSource = Files.asByteSource(file);
Payload payload = Payloads.newByteSourcePayload(byteSource);
objectApi.put(hashedName, payload);

问题:

有人经历过类似的行为吗?也许有人有解决此类问题的方法?

谢谢

阿隆

最佳答案

网络并不可靠,因此在使用云服务时,尤其是在处理许多文件时,可能会出现一些异常情况。专门针对 jclouds 上传,我们在这里有一些示例代码:

https://github.com/jclouds/jclouds-examples/tree/master/blobstore-uploader

编辑:我还添加了一个 JIRA 问题,以确保我们在 swift 中添加专门针对这种情况的测试:

https://issues.apache.org/jira/browse/JCLOUDS-965

关于java - jclouds IOExpectation : Error writing request body to server,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31453750/

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