[ 
https://issues.apache.org/jira/browse/JCLOUDS-1064?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15123082#comment-15123082
 ] 

Zack Shoylev commented on JCLOUDS-1064:
---------------------------------------

I think I was able to reproduce this. I need to double-check some more, but I 
think jclouds is having issues handling the 100 Continue response, which is 
expected before the 200 OK response from the server. At least in my test cases. 
This will require further investigation to fix, though, as I was pretty sure 
100 Continue was handled automatically.

Test case I am using: https://gist.github.com/zack-shoylev/de460bd84041e7db44aa

Results in null etag returned. Logging has:

2016-01-29 00:44:09,088 DEBUG [jclouds.headers] [pool-1-thread-1] >> POST 
http://localhost:62342/tokens HTTP/1.1
2016-01-29 00:44:09,088 DEBUG [jclouds.headers] [pool-1-thread-1] >> Accept: 
application/json
2016-01-29 00:44:09,088 DEBUG [jclouds.headers] [pool-1-thread-1] >> 
Content-Type: application/json
2016-01-29 00:44:09,088 DEBUG [jclouds.headers] [pool-1-thread-1] >> 
Content-Length: 95
2016-01-29 00:44:09,102 DEBUG [jclouds.headers] [pool-1-thread-1] << HTTP/1.1 
200 OK
2016-01-29 00:44:09,102 DEBUG [jclouds.headers] [pool-1-thread-1] << Accept: 
application/json
2016-01-29 00:44:09,103 DEBUG [jclouds.headers] [pool-1-thread-1] << 
Content-Type: application/unknown
2016-01-29 00:44:09,103 DEBUG [jclouds.headers] [pool-1-thread-1] << 
Content-Length: 9871
2016-01-29 00:44:09,141 DEBUG [jclouds.headers] [pool-1-thread-1] >> PUT 
http://localhost:62342/v1/MossoCloudFS_5bcf396e-39dd-45ff-93a1-712b9aba90a9/myContainer/myObject
 HTTP/1.1
2016-01-29 00:44:09,141 DEBUG [jclouds.headers] [pool-1-thread-1] >> Expect: 
100-continue
2016-01-29 00:44:09,141 DEBUG [jclouds.headers] [pool-1-thread-1] >> Accept: 
application/json
2016-01-29 00:44:09,141 DEBUG [jclouds.headers] [pool-1-thread-1] >> 
X-Object-Meta-apiname: swift
2016-01-29 00:44:09,141 DEBUG [jclouds.headers] [pool-1-thread-1] >> 
X-Object-Meta-apiversion: v1.1
2016-01-29 00:44:09,141 DEBUG [jclouds.headers] [pool-1-thread-1] >> 
Transfer-Encoding: chunked
2016-01-29 00:44:09,141 DEBUG [jclouds.headers] [pool-1-thread-1] >> 
X-Auth-Token: bb03a23aa8271291a7aaa9aaa2aaaaaa
2016-01-29 00:44:09,141 DEBUG [jclouds.headers] [pool-1-thread-1] >> 
Content-Type: application/unknown
2016-01-29 00:44:09,144 DEBUG [jclouds.headers] [pool-1-thread-1] << HTTP/1.1 
100 Continue
2016-01-29 00:44:09,144 DEBUG [jclouds.headers] [pool-1-thread-1] << 
Content-Type: application/unknown
2016-01-29 00:44:09,144 DEBUG [jclouds.headers] [pool-1-thread-1] << 
Content-Length: 0


> 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)

Reply via email to