[
https://issues.apache.org/jira/browse/JCLOUDS-249?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Andrew Gaul resolved JCLOUDS-249.
---------------------------------
Resolution: Fixed
Fix Version/s: 1.7.0
JCLOUDS-356 resolved this issue with commit
15a3c04fb7e488117cb1b65d13c99f4499568b3f.
> Swift multipart upload from InputStream payload fails
> -----------------------------------------------------
>
> Key: JCLOUDS-249
> URL: https://issues.apache.org/jira/browse/JCLOUDS-249
> Project: jclouds
> Issue Type: Bug
> Components: jclouds-blobstore
> Affects Versions: 1.6.0
> Environment: OS X 10.8.4, Oracle Java 1.7.0_25
> Reporter: Francis Devereux
> Assignee: Andrew Gaul
> Fix For: 1.7.0
>
>
> If I try to put a multipart blob using an InputStream payload I get the
> following exception:
> {code}
> java.lang.RuntimeException: java.io.IOException: Stream closed
> at com.google.common.base.Throwables.propagate(Throwables.java:160)
> at
> org.jclouds.io.internal.BasePayloadSlicer.doSlice(BasePayloadSlicer.java:83)
> at
> org.jclouds.io.internal.BasePayloadSlicer.slice(BasePayloadSlicer.java:62)
> at
> org.jclouds.openstack.swift.blobstore.strategy.internal.SequentialMultipartUploadStrategy.execute(SequentialMultipartUploadStrategy.java:73)
> at
> org.jclouds.openstack.swift.blobstore.SwiftBlobStore.putBlob(SwiftBlobStore.java:214)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at
> com.google.inject.internal.DelegatingInvocationHandler.invoke(DelegatingInvocationHandler.java:37)
> at com.sun.proxy.$Proxy63.putBlob(Unknown Source)
> at
> com.brightinteractive.jclouds.PutGetDeleteMultiPartTest.putMultiPartBlob(PutGetDeleteMultiPartTest.java:132)
> at
> com.brightinteractive.jclouds.PutGetDeleteMultiPartTest.putGetDelete(PutGetDeleteMultiPartTest.java:65)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
> at
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
> at
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
> at
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
> at
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
> at
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
> at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
> at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
> at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
> at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
> at
> com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:77)
> at
> com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195)
> at
> com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
> Caused by: java.io.IOException: Stream closed
> at
> java.io.BufferedInputStream.getBufIfOpen(BufferedInputStream.java:162)
> at java.io.BufferedInputStream.skip(BufferedInputStream.java:357)
> at com.google.common.io.ByteStreams.skipFully(ByteStreams.java:755)
> at
> org.jclouds.io.internal.BasePayloadSlicer.doSlice(BasePayloadSlicer.java:81)
> ... 39 more
> {code}
> Code to reproduce here:
> https://github.com/brightinteractive/jclouds-prototype/blob/825f704266191bb35413838260681775efa90cb9/src/test/java/com/brightinteractive/jclouds/PutGetDeleteMultiPartTest.java
> With similar code that uses a File payload instead of an InputStream the put
> succeeds (although getting the blob still fails due to JCLOUDS-247):
> https://github.com/brightinteractive/jclouds-prototype/blob/1cfa515b15658b3b7f74b2714dbf5b47fb4e14f2/src/test/java/com/brightinteractive/jclouds/PutGetDeleteMultiPartTest.java
> Note regarding the sample code: you won't be able to run the
> jclouds-prototype project exactly as-is because it uses a non-public parent
> POM, bright-parent. I can prepare a more easily runnable test case if needed,
> just let me know.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)