如果我将jclouds与multipart()选项一起使用将文件上传到b2,则会收到如下错误消息
Exception in thread "main" java.lang.IllegalArgumentException: large files must have at least 2 parts
at org.jclouds.b2.handlers.ParseB2ErrorFromJsonContent.refineException(ParseB2ErrorFromJsonContent.java:45)
at org.jclouds.b2.handlers.ParseB2ErrorFromJsonContent.handleError(ParseB2ErrorFromJsonContent.java:58)
at org.jclouds.http.handlers.DelegatingErrorHandler.handleError(DelegatingErrorHandler.java:65)
at org.jclouds.http.internal.BaseHttpCommandExecutorService.shouldContinue(BaseHttpCommandExecutorService.java:138)
at org.jclouds.http.internal.BaseHttpCommandExecutorService.invoke(BaseHttpCommandExecutorService.java:107)
at org.jclouds.rest.internal.InvokeHttpMethod.invoke(InvokeHttpMethod.java:91)
at org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:74)
at org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:45)
at org.jclouds.reflect.FunctionalReflection$FunctionalInvocationHandler.handleInvocation(FunctionalReflection.java:117)
at com.google.common.reflect.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:87)
at com.sun.proxy.$Proxy57.finishLargeFile(Unknown Source)
at org.jclouds.b2.blobstore.B2BlobStore.completeMultipartUpload(B2BlobStore.java:356)
at org.jclouds.blobstore.internal.BaseBlobStore.putMultipartBlob(BaseBlobStore.java:376)
at org.jclouds.blobstore.internal.BaseBlobStore.putMultipartBlob(BaseBlobStore.java:347)
at org.jclouds.b2.blobstore.B2BlobStore.putBlob(B2BlobStore.java:233)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.google.inject.internal.DelegatingInvocationHandler.invoke(DelegatingInvocationHandler.java:37)
at com.sun.proxy.$Proxy41.putBlob(Unknown Source)
at b2.NewMain.runMain(NewMain.java:76)
at b2.NewMain.main(NewMain.java:48)
Caused by: org.jclouds.b2.B2ResponseException: request POST https://api.backblazeb2.com/b2api/v1/b2_finish_large_file HTTP/1.1 failed with code 400, error: B2Error{code=bad_request, message=large files must have at least 2 parts, status=400}
... 22 more
我正在使用的代码如下所示
PayloadBlobBuilder blobBuilder = blobStore.blobBuilder(remoteFileName)
.payload(payload)
.contentLength(payload.size());
Blob blob = blobBuilder.build();
String eTag = blobStore.putBlob(containerName, blob, multipart());
同一文件的相同代码适用于aws-s3,google-cloud-storage,azureblob。我正在使用 jclouds 2.1.1 。这是一个已知问题吗?
答案 0 :(得分:0)
我打开JCLOUDS-1477来跟踪此错误,jclouds 2.1.2-SNAPSHOT和2.2.0-SNAPSHOT应该包含一个修复程序。请测试并报告该问题中的其他症状。