简体   繁体   English

jclouds IOExpection:将请求主体写入服务器时出错

[英]jclouds IOExpection: Error writing request body to server

We are using jclouds with Rackspace and when uploading lots of files via cloudfile api ( multi threaded ) 我们在Rackspace上使用jclouds ,并通过cloudfile apimulti threaded )上传大量文件时

Once in while we are getting an exception on objectApi.put line (see example code at bottom) 当我们在objectApi.put行上objectApi.put异常时(请参阅底部的示例代码)

Exception 例外

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

Similar issue with S3 S3类似问题

can be found here 可以在这里找到

Example Code 范例程式码

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

The question: 问题:

Any one has experience some behavior like that? 任何人都经历过这样的行为吗? maybe someone has workaround for that kind of issue? 也许有人可以解决此类问题?

Thanks 谢谢

Alon 阿龙

Networks are unreliable, so expect some exceptions when using cloud services, especially when dealing with many files. 网络不可靠,因此在使用云服务时(特别是在处理许多文件时)会出现一些例外情况。 Specifically for jclouds uploads, we have some example code here: 特别是对于jclouds上传,我们在这里有一些示例代码:

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

Edit: I have also added a JIRA issue to make sure we add a test specifically for this situation in swift: 编辑:我还添加了一个JIRA问题,以确保我们迅速添加针对此情况的测试:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用 Gmail API 将请求正文写入服务器时出错 - Error Writing Request Body to Server with Gmail API Ant:部署到tomcat时“IOException:将请求主体写入服务器时出错” - Ant: “IOException: Error writing request body to server” on deployment to tomcat 调用云jclouds时出错 - Error calling to the cloud jclouds JClouds RackspaceUK不会启动服务器 - JClouds RackspaceUK wont start Server 编写可压缩请求正文的OkHttp拦截器 - Writing an OkHttp Interceptor that compresses request body 将 POST 请求的 BODY 传递给服务器 - Passing a BODY of a POST request to the server 写入服务器时出错 - Error writing to server 将 CSV 文件写入 Spring Reactive WebClient 的请求正文 - Writing CSV file to a request body of Spring Reactive WebClient Jclouds分段上传到Google Cloud Storage失败,出现400错误请求 - Jclouds multipart upload to Google Cloud Storage failing with 400 Bad Request 创建JClouds SwiftApi时出错:无法实例化提供程序org.jclouds.openstack.keystone.v2_0.KeystoneApiMetadata - Error creating JClouds SwiftApi: Provider org.jclouds.openstack.keystone.v2_0.KeystoneApiMetadata could not be instantiated
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM