[
https://issues.apache.org/jira/browse/JCLOUDS-1064?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15118385#comment-15118385
]
Zack Shoylev commented on JCLOUDS-1064:
---------------------------------------
Hm, no, the null pointer exception happens when the regular (one single part)
PUT upload returns a null etag somehow (even though the log has an Etag in the
response). Using the log you provided, I have not been able to reproduce this.
Another question for your code: it should be sufficient to supply just the
file, you shouldn't have to supply md5 or length. The example we use usually
just has something like:
Blob blob =
blobStore.blobBuilder(objectName).payload(Files.asByteSource(input))
.contentType(MediaType.APPLICATION_OCTET_STREAM).contentDisposition(objectName).build();
(from here:
https://github.com/jclouds/jclouds-examples/blob/master/blobstore-largeblob/src/main/java/org/jclouds/examples/blobstore/largeblob/MainApp.java)
I will try a few more things, but can you modify your code to be closer to the
example code and see if this still happens?
> multipart upload throwing : NullPointerException: Null partETag
> ---------------------------------------------------------------
>
> Key: JCLOUDS-1064
> URL: https://issues.apache.org/jira/browse/JCLOUDS-1064
> Project: jclouds
> Issue Type: Bug
> Components: jclouds-blobstore
> Affects Versions: 2.0.0
> Reporter: Ramesh Gojji
> Assignee: Zack Shoylev
> Labels: openstack-swift
>
> I am trying to upload a file in chunks to the openstack-swift. Here is the
> snippet of the code I am using to upload a file named dom4j-1.6.1.jar in
> chunks.
> blobStore.putBlob("jclouds-example", blob) does work, but if I add multipart
> to the method, then I get NullPointerException: Null partETag.
> {code:java}
> ByteSource payload = Files.asByteSource(tempFile);
> Blob blob = blobStore.blobBuilder(objectName)
> .payload(payload)
> .contentDisposition("attachment; filename=dom4j-1.6.1.jar")
> .contentMD5(payload.hash(Hashing.md5()))
> .contentLength(payload.size())
> .contentType(MediaType.OCTET_STREAM.toString())
> .build();
> System.out.println(blob.getMetadata().getName());
> // Upload the Blob
> String eTag = blobStore.putBlob("jclouds-example", blob,
> multipart());
> {code}
> Exception Stacktrace:
> {noformat}
> Exception in thread "main" java.lang.NullPointerException: Null partETag
> at
> org.jclouds.blobstore.domain.AutoValue_MultipartPart.<init>(AutoValue_MultipartPart.java:20)
> at
> org.jclouds.blobstore.domain.MultipartPart.create(MultipartPart.java:29)
> at
> org.jclouds.openstack.swift.v1.blobstore.RegionScopedSwiftBlobStore.uploadMultipartPart(RegionScopedSwiftBlobStore.java:481)
> at
> org.jclouds.openstack.swift.v1.blobstore.RegionScopedSwiftBlobStore.putMultipartBlob(RegionScopedSwiftBlobStore.java:567)
> at
> org.jclouds.openstack.swift.v1.blobstore.RegionScopedSwiftBlobStore.putBlob(RegionScopedSwiftBlobStore.java:244)
> at JCloudTest.<init>(JCloudTest.java:75)
> at JCloudTest.main(JCloudTest.java:26)
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)