jClouds Swift Bloblist NullPointerException
jClouds Swift Bloblist NullPointerException
我正在编写一个项目来列出我的 dreamhost 对象存储中的上传文件。但是下面的代码给我错误..
PageSet<? extends StorageMetadata> objects = blobStore.list(bucket);
我如何解决上述问题以获取存储桶中的所有对象列表。存储桶名称有效。
例外情况是:
May 01, 2015 9:35:09 AM org.jclouds.logging.jdk.JDKLogger logError
SEVERE: Error parsing input: name
java.lang.NullPointerException: name
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:229)
at org.jclouds.openstack.swift.domain.internal.ObjectInfoImpl.<init>(ObjectInfoImpl.java:154)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at com.google.common.reflect.Invokable$ConstructorInvokable.invokeInternal(Invokable.java:242)
at com.google.common.reflect.Invokable.invoke(Invokable.java:102)
at org.jclouds.json.internal.DeserializationConstructorAndReflectiveTypeAdapterFactory$DeserializeIntoParameterizedConstructor.newInstance(DeserializationConstructorAndReflectiveTypeAdapterFactory.java:224)
at org.jclouds.json.internal.DeserializationConstructorAndReflectiveTypeAdapterFactory$DeserializeIntoParameterizedConstructor.read(DeserializationConstructorAndReflectiveTypeAdapterFactory.java:204)
at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:81)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:60)
at com.google.gson.Gson.fromJson(Gson.java:805)
at com.google.gson.Gson.fromJson(Gson.java:770)
at com.google.gson.Gson.fromJson(Gson.java:719)
at org.jclouds.json.internal.GsonWrapper.fromJson(GsonWrapper.java:42)
at org.jclouds.http.functions.ParseJson.apply(ParseJson.java:83)
at org.jclouds.openstack.swift.functions.ParseObjectInfoListFromJsonResponse.apply(ParseObjectInfoListFromJsonResponse.java:71)
at org.jclouds.openstack.swift.functions.ParseObjectInfoListFromJsonResponse.apply(ParseObjectInfoListFromJsonResponse.java:51)
at org.jclouds.http.functions.ParseJson.apply(ParseJson.java:62)
at org.jclouds.http.functions.ParseJson.apply(ParseJson.java:42)
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.rest.internal.DelegatesToInvocationFunction.handle(DelegatesToInvocationFunction.java:156)
at org.jclouds.rest.internal.DelegatesToInvocationFunction.invoke(DelegatesToInvocationFunction.java:123)
at com.sun.proxy.$Proxy49.listObjects(Unknown Source)
at org.jclouds.openstack.swift.blobstore.SwiftBlobStore.list(SwiftBlobStore.java:153)
at org.jclouds.blobstore.internal.BaseBlobStore.list(BaseBlobStore.java:81)
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:497)
at com.google.inject.internal.DelegatingInvocationHandler.invoke(DelegatingInvocationHandler.java:37)
at com.sun.proxy.$Proxy51.list(Unknown Source)
at com.tigerworks.objectstore.sample.swift.BlobStoreDemo.listBucketBlobs(BlobStoreDemo.java:54)
at com.tigerworks.objectstore.sample.swift.BlobStoreDemo.runBlobStoreDemo(BlobStoreDemo.java:91)
at com.tigerworks.Main.main(Main.java:12)
Exception in thread "main" org.jclouds.http.HttpResponseException: Error parsing input: name
{statusCode=200, message=OK, headers={Transfer-Encoding=[chunked], Server=[Apache], Date=[Fri, 01 May 2015 03:35:09 GMT]}, payload=[content=true, contentMetadata=[contentDisposition=null, contentEncoding=null, contentLanguage=null, contentLength=null, contentMD5=null, contentType=application/json; charset=utf-8, expires=null], written=false]}
at org.jclouds.http.functions.ParseJson.apply(ParseJson.java:68)
at org.jclouds.http.functions.ParseJson.apply(ParseJson.java:42)
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.rest.internal.DelegatesToInvocationFunction.handle(DelegatesToInvocationFunction.java:156)
at org.jclouds.rest.internal.DelegatesToInvocationFunction.invoke(DelegatesToInvocationFunction.java:123)
at com.sun.proxy.$Proxy49.listObjects(Unknown Source)
at org.jclouds.openstack.swift.blobstore.SwiftBlobStore.list(SwiftBlobStore.java:153)
at org.jclouds.blobstore.internal.BaseBlobStore.list(BaseBlobStore.java:81)
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:497)
at com.google.inject.internal.DelegatingInvocationHandler.invoke(DelegatingInvocationHandler.java:37)
at com.sun.proxy.$Proxy51.list(Unknown Source)
at com.tigerworks.objectstore.sample.swift.BlobStoreDemo.listBucketBlobs(BlobStoreDemo.java:54)
at com.tigerworks.objectstore.sample.swift.BlobStoreDemo.runBlobStoreDemo(BlobStoreDemo.java:91)
at com.tigerworks.Main.main(Main.java:12)
Caused by: java.lang.NullPointerException: name
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:229)
at org.jclouds.openstack.swift.domain.internal.ObjectInfoImpl.<init>(ObjectInfoImpl.java:154)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at com.google.common.reflect.Invokable$ConstructorInvokable.invokeInternal(Invokable.java:242)
at com.google.common.reflect.Invokable.invoke(Invokable.java:102)
at org.jclouds.json.internal.DeserializationConstructorAndReflectiveTypeAdapterFactory$DeserializeIntoParameterizedConstructor.newInstance(DeserializationConstructorAndReflectiveTypeAdapterFactory.java:224)
at org.jclouds.json.internal.DeserializationConstructorAndReflectiveTypeAdapterFactory$DeserializeIntoParameterizedConstructor.read(DeserializationConstructorAndReflectiveTypeAdapterFactory.java:204)
at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:81)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:60)
at com.google.gson.Gson.fromJson(Gson.java:805)
at com.google.gson.Gson.fromJson(Gson.java:770)
at com.google.gson.Gson.fromJson(Gson.java:719)
at org.jclouds.json.internal.GsonWrapper.fromJson(GsonWrapper.java:42)
at org.jclouds.http.functions.ParseJson.apply(ParseJson.java:83)
at org.jclouds.openstack.swift.functions.ParseObjectInfoListFromJsonResponse.apply(ParseObjectInfoListFromJsonResponse.java:71)
at org.jclouds.openstack.swift.functions.ParseObjectInfoListFromJsonResponse.apply(ParseObjectInfoListFromJsonResponse.java:51)
at org.jclouds.http.functions.ParseJson.apply(ParseJson.java:62)
... 18 more
系统中有一个文件夹。当存储桶中有文件夹时,列表会给出异常。
我正在编写一个项目来列出我的 dreamhost 对象存储中的上传文件。但是下面的代码给我错误..
PageSet<? extends StorageMetadata> objects = blobStore.list(bucket);
我如何解决上述问题以获取存储桶中的所有对象列表。存储桶名称有效。
例外情况是:
May 01, 2015 9:35:09 AM org.jclouds.logging.jdk.JDKLogger logError
SEVERE: Error parsing input: name
java.lang.NullPointerException: name
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:229)
at org.jclouds.openstack.swift.domain.internal.ObjectInfoImpl.<init>(ObjectInfoImpl.java:154)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at com.google.common.reflect.Invokable$ConstructorInvokable.invokeInternal(Invokable.java:242)
at com.google.common.reflect.Invokable.invoke(Invokable.java:102)
at org.jclouds.json.internal.DeserializationConstructorAndReflectiveTypeAdapterFactory$DeserializeIntoParameterizedConstructor.newInstance(DeserializationConstructorAndReflectiveTypeAdapterFactory.java:224)
at org.jclouds.json.internal.DeserializationConstructorAndReflectiveTypeAdapterFactory$DeserializeIntoParameterizedConstructor.read(DeserializationConstructorAndReflectiveTypeAdapterFactory.java:204)
at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:81)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:60)
at com.google.gson.Gson.fromJson(Gson.java:805)
at com.google.gson.Gson.fromJson(Gson.java:770)
at com.google.gson.Gson.fromJson(Gson.java:719)
at org.jclouds.json.internal.GsonWrapper.fromJson(GsonWrapper.java:42)
at org.jclouds.http.functions.ParseJson.apply(ParseJson.java:83)
at org.jclouds.openstack.swift.functions.ParseObjectInfoListFromJsonResponse.apply(ParseObjectInfoListFromJsonResponse.java:71)
at org.jclouds.openstack.swift.functions.ParseObjectInfoListFromJsonResponse.apply(ParseObjectInfoListFromJsonResponse.java:51)
at org.jclouds.http.functions.ParseJson.apply(ParseJson.java:62)
at org.jclouds.http.functions.ParseJson.apply(ParseJson.java:42)
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.rest.internal.DelegatesToInvocationFunction.handle(DelegatesToInvocationFunction.java:156)
at org.jclouds.rest.internal.DelegatesToInvocationFunction.invoke(DelegatesToInvocationFunction.java:123)
at com.sun.proxy.$Proxy49.listObjects(Unknown Source)
at org.jclouds.openstack.swift.blobstore.SwiftBlobStore.list(SwiftBlobStore.java:153)
at org.jclouds.blobstore.internal.BaseBlobStore.list(BaseBlobStore.java:81)
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:497)
at com.google.inject.internal.DelegatingInvocationHandler.invoke(DelegatingInvocationHandler.java:37)
at com.sun.proxy.$Proxy51.list(Unknown Source)
at com.tigerworks.objectstore.sample.swift.BlobStoreDemo.listBucketBlobs(BlobStoreDemo.java:54)
at com.tigerworks.objectstore.sample.swift.BlobStoreDemo.runBlobStoreDemo(BlobStoreDemo.java:91)
at com.tigerworks.Main.main(Main.java:12)
Exception in thread "main" org.jclouds.http.HttpResponseException: Error parsing input: name
{statusCode=200, message=OK, headers={Transfer-Encoding=[chunked], Server=[Apache], Date=[Fri, 01 May 2015 03:35:09 GMT]}, payload=[content=true, contentMetadata=[contentDisposition=null, contentEncoding=null, contentLanguage=null, contentLength=null, contentMD5=null, contentType=application/json; charset=utf-8, expires=null], written=false]}
at org.jclouds.http.functions.ParseJson.apply(ParseJson.java:68)
at org.jclouds.http.functions.ParseJson.apply(ParseJson.java:42)
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.rest.internal.DelegatesToInvocationFunction.handle(DelegatesToInvocationFunction.java:156)
at org.jclouds.rest.internal.DelegatesToInvocationFunction.invoke(DelegatesToInvocationFunction.java:123)
at com.sun.proxy.$Proxy49.listObjects(Unknown Source)
at org.jclouds.openstack.swift.blobstore.SwiftBlobStore.list(SwiftBlobStore.java:153)
at org.jclouds.blobstore.internal.BaseBlobStore.list(BaseBlobStore.java:81)
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:497)
at com.google.inject.internal.DelegatingInvocationHandler.invoke(DelegatingInvocationHandler.java:37)
at com.sun.proxy.$Proxy51.list(Unknown Source)
at com.tigerworks.objectstore.sample.swift.BlobStoreDemo.listBucketBlobs(BlobStoreDemo.java:54)
at com.tigerworks.objectstore.sample.swift.BlobStoreDemo.runBlobStoreDemo(BlobStoreDemo.java:91)
at com.tigerworks.Main.main(Main.java:12)
Caused by: java.lang.NullPointerException: name
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:229)
at org.jclouds.openstack.swift.domain.internal.ObjectInfoImpl.<init>(ObjectInfoImpl.java:154)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at com.google.common.reflect.Invokable$ConstructorInvokable.invokeInternal(Invokable.java:242)
at com.google.common.reflect.Invokable.invoke(Invokable.java:102)
at org.jclouds.json.internal.DeserializationConstructorAndReflectiveTypeAdapterFactory$DeserializeIntoParameterizedConstructor.newInstance(DeserializationConstructorAndReflectiveTypeAdapterFactory.java:224)
at org.jclouds.json.internal.DeserializationConstructorAndReflectiveTypeAdapterFactory$DeserializeIntoParameterizedConstructor.read(DeserializationConstructorAndReflectiveTypeAdapterFactory.java:204)
at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:81)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:60)
at com.google.gson.Gson.fromJson(Gson.java:805)
at com.google.gson.Gson.fromJson(Gson.java:770)
at com.google.gson.Gson.fromJson(Gson.java:719)
at org.jclouds.json.internal.GsonWrapper.fromJson(GsonWrapper.java:42)
at org.jclouds.http.functions.ParseJson.apply(ParseJson.java:83)
at org.jclouds.openstack.swift.functions.ParseObjectInfoListFromJsonResponse.apply(ParseObjectInfoListFromJsonResponse.java:71)
at org.jclouds.openstack.swift.functions.ParseObjectInfoListFromJsonResponse.apply(ParseObjectInfoListFromJsonResponse.java:51)
at org.jclouds.http.functions.ParseJson.apply(ParseJson.java:62)
... 18 more
系统中有一个文件夹。当存储桶中有文件夹时,列表会给出异常。