簡體   English   中英

枚舉結果時發生錯誤,請檢查原始異常以獲取詳細信息

[英]An error occurred while enumerating the result, check the original exception for details

我目前在Android Studio上使用Azure Blob存儲。 我無法遍歷Blob容器

它告訴我

08-10 00:37:16.073 8538-8594/com.psv.starvision W/System.err: java.util.NoSuchElementException: An error occurred while enumerating the result, check the original exception for details.
08-10 00:37:16.073 8538-8594/com.psv.starvision W/System.err:     at com.microsoft.azure.storage.core.LazySegmentedIterator.hasNext(LazySegmentedIterator.java:113)
08-10 00:37:16.073 8538-8594/com.psv.starvision W/System.err:     at com.psv.starvision.blobHandler.ListImages(blobHandler.java:81)

Caused by: com.microsoft.azure.storage.StorageException: Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
08-11 14:10:05.011 8877-8925/com.psv.starvision W/System.err:     at com.microsoft.azure.storage.core.StorageRequest.materializeException(StorageRequest.java:306)
08-11 14:10:05.011 8877-8925/com.psv.starvision W/System.err:     at com.microsoft.azure.storage.core.ExecutionEngine.executeWithRetry(ExecutionEngine.java:177)
08-11 14:10:05.011 8877-8925/com.psv.starvision W/System.err:     at com.microsoft.azure.storage.core.LazySegmentedIterator.hasNext(LazySegmentedIterator.java:109)

這是ListImages.Class

public static String[] ListImages() {
    LinkedList<String> blobNames = new LinkedList<>();
    try {
        CloudBlobContainer container = getContainer();
        Log.e( "listimages: ", "container " + container );

        Iterable<ListBlobItem> blobs = container.listBlobs();
        Log.e( "listimages: ", "blobs " + blobs );

        blobNames = new LinkedList<>();
        for(ListBlobItem blob: blobs) { // the line that hit an error
            blobNames.add(((CloudBlockBlob) blob).getName());
        }

        Log.e("ListImages: ", "size" + blobNames.size() );
        return blobNames.toArray(new String[blobNames.size()]);

    } catch (Exception ex){
        ex.printStackTrace();
    }


    return blobNames.toArray(new String[blobNames.size()]);
}

有什么問題的想法嗎? 有問題的容器不為空; 我能夠記錄containerblobs

謝謝,麻煩您了!!

謝謝您的幫助!

我的錯誤是在gradle腳本中

依賴關系已設置

compile group: 'com.microsoft.azure', name: 'azure-storage', version: '1.2.0'

什么時候應該

compile 'com.microsoft.azure.android:azure-storage-android:0.8.0@aar'

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM