[
https://issues.apache.org/jira/browse/JCLOUDS-1504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17229958#comment-17229958
]
Kristian Atanasov commented on JCLOUDS-1504:
--------------------------------------------
Hello [~gaul],
I hit the same issue with my application using aws-s3 objectstore with jclouds.
It does not occur on every
{code:java}
PageSet<? extends StorageMetadata> list(String container, ListContainerOptions
options);{code}
method call but when it occurs, throws the following exception:
{code:java}java.lang.NullPointerException: Cannot invoke
"org.jclouds.blobstore.domain.StorageMetadata.getName()" because
"storageMetadata" is null
at
org.jclouds.blobstore.strategy.internal.FetchBlobMetadata.apply(FetchBlobMetadata.java:112)
at org.jclouds.s3.blobstore.S3BlobStore.list(S3BlobStore.java:178)
at
org.cloudfoundry.multiapps.controller.persistence.services.ObjectStoreFileStorage.getEntryNames(ObjectStoreFileStorage.java:188)
at
org.cloudfoundry.multiapps.controller.persistence.services.ObjectStoreFileStorage.removeBlobsByFilter(ObjectStoreFileStorage.java:180)
at
org.cloudfoundry.multiapps.controller.persistence.services.ObjectStoreFileStorage.deleteFilesBySpace(ObjectStoreFileStorage.java:90)
at
org.cloudfoundry.multiapps.controller.persistence.services.FileService.deleteBySpace(FileService.java:133){code}
I am using jclouds version 2.2.1 .
I have tried to filter nulls from PageSet but this won't help because in latest
version there is [new
change|https://github.com/apache/jclouds/commit/5ac92111c4e9347c492a16ecd402acafdb1f9cd7#diff-e5fdbb44b36c6fd2f70b7cb31c38a6fc6facb0d2c8141a3e558538b7d6aecbbbR112]
which is related with [list() result
order|https://issues.apache.org/jira/browse/JCLOUDS-1543]. Now I can't filter
out null elements from PageSet in my code because the issue is inside jclouds
library. So what I can do to avoid this NPE and retrieve blobs with metadata
together without any additional performance impact?
Thanks,
Kristian
> BlobStore.list(container, ListContainerOptions) returns collection containing
> null elements
> --------------------------------------------------------------------------------------------
>
> Key: JCLOUDS-1504
> URL: https://issues.apache.org/jira/browse/JCLOUDS-1504
> Project: jclouds
> Issue Type: Bug
> Reporter: Енчо Белезирев
> Priority: Blocker
> Attachments: jclouds-wire.log, jclouds.log
>
>
> Hello,
> I am SAP developer and we are using jclouds for the communication with our
> blob stores.
> We have issue with the querying of the StorageMetadata for some blobs. We are
> using the method from the BlobStore -
> {code:java}
> PageSet<? extends StorageMetadata> list(String container,
> ListContainerOptions options);{code}
> However, when we are using the method, we are providing
> ListContainerOptions.Builder.withDetails() because we want to take directly
> the userMetadata field from the StorageMetadata object and to use it later
> on. Here comes the problem, sometimes, when the method is being executed, the
> list that is being returned contains null objects. This is a problem because
> we want each StorageMetadata to be non-null.
> I have validated our entries in the container and it seemed that there are no
> suspicious entries in it(which might cause the issue).
> Could you share some information what could have caused the issue and
> eventually, is there a way to workaround this?
>
> We are using aws-s3 implementation of the blob store.
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)