簡體   English   中英

在Spring MVC應用程序中使用jclouds創建BlobContext時出錯

[英]Error creating BlobContext using jclouds in a Spring MVC application

我有一個Spring MVC 4.0.1 Web應用程序,需要將文件上傳到Rackspace Cloud Files。 我正在使用Apache jClouds來執行此操作。 嘗試使用以下代碼創建BlobStore時:

BlobStoreContext context = ContextBuilder.newBuilder("cloudfiles-us").credentials("username","password").buildView(BlobStoreContext.class);

我得到以下異常:

com.google.inject.CreationException: Guice creation errors:

1) No implementation for com.google.common.base.Supplier<java.lang.String> annotated with @org.jclouds.openstack.swift.TemporaryUrlKey() was bound.
  while locating com.google.common.base.Supplier<java.lang.String> annotated with @org.jclouds.openstack.swift.TemporaryUrlKey()
    for parameter 4 at org.jclouds.openstack.swift.blobstore.SwiftBlobSigner.<init>(SwiftBlobSigner.java:88)
  at org.jclouds.cloudfiles.CloudFilesApiMetadata$CloudFilesTemporaryUrlExtensionModule.bindRequestSigner(CloudFilesApiMetadata.java:101)

2) No implementation for org.jclouds.openstack.swift.CommonSwiftClient was bound.
  while locating org.jclouds.openstack.swift.CommonSwiftClient
    for parameter 4 at org.jclouds.cloudfiles.blobstore.CloudFilesBlobStore.<init>(CloudFilesBlobStore.java:63)
  at org.jclouds.cloudfiles.blobstore.config.CloudFilesBlobStoreContextModule.configure(CloudFilesBlobStoreContextModule.java:64)

3) No implementation for org.jclouds.openstack.swift.CommonSwiftClient was bound.
  while locating org.jclouds.openstack.swift.CommonSwiftClient
    for parameter 0 at org.jclouds.openstack.swift.blobstore.strategy.internal.SequentialMultipartUploadStrategy.<init>(SequentialMultipartUploadStrategy.java:51)
  while locating com.google.inject.Provider<org.jclouds.openstack.swift.blobstore.strategy.internal.MultipartUploadStrategy>
    for parameter 14 at org.jclouds.cloudfiles.blobstore.CloudFilesBlobStore.<init>(CloudFilesBlobStore.java:63)
  at org.jclouds.cloudfiles.blobstore.config.CloudFilesBlobStoreContextModule.configure(CloudFilesBlobStoreContextModule.java:64)

4) org.jclouds.rest.config.SyncToAsyncHttpApiProvider<org.jclouds.openstack.keystone.v1_1.AuthenticationClient, A> cannot be used as a key; It is not fully specified.

5) org.jclouds.rest.config.SyncToAsyncHttpApiProvider<org.jclouds.rest.HttpClient, A> cannot be used as a key; It is not fully specified.

6) org.jclouds.rest.config.SyncToAsyncHttpApiProvider<org.jclouds.cloudfiles.CloudFilesClient, A> cannot be used as a key; It is not fully specified.

7) org.jclouds.rest.config.SyncToAsyncHttpApiProvider<org.jclouds.openstack.swift.extensions.TemporaryUrlKeyApi, A> cannot be used as a key; It is not fully specified.

8) org.jclouds.rest.RestContext<org.jclouds.cloudfiles.CloudFilesClient, A> cannot be used as a key; It is not fully specified.

9) No implementation for org.jclouds.location.suppliers.RegionIdToURISupplier$Factory was bound.
  at org.jclouds.cloudfiles.config.CloudFilesRestClientModule$StorageAndCDNManagementEndpointModule.provideCDNUrl(CloudFilesRestClientModule.java:67)

10) No implementation for org.jclouds.openstack.keystone.v1_1.suppliers.V1DefaultRegionIdSupplier$Factory was bound.
  at org.jclouds.cloudfiles.config.CloudFilesRestClientModule$StorageAndCDNManagementEndpointModule.provideCDNUrl(CloudFilesRestClientModule.java:67)

11) No implementation for org.jclouds.location.suppliers.RegionIdToURISupplier$Factory was bound.
  at org.jclouds.cloudfiles.config.CloudFilesRestClientModule$StorageAndCDNManagementEndpointModule.provideStorageUrl(CloudFilesRestClientModule.java:76)

12) No implementation for org.jclouds.openstack.keystone.v1_1.suppliers.V1DefaultRegionIdSupplier$Factory was bound.
  at org.jclouds.cloudfiles.config.CloudFilesRestClientModule$StorageAndCDNManagementEndpointModule.provideStorageUrl(CloudFilesRestClientModule.java:76)

13) No implementation for org.jclouds.openstack.keystone.v1_1.AuthenticationClient was bound.
  at org.jclouds.rest.config.BinderUtils.bindHttpApiProvider(BinderUtils.java:106)

14) No implementation for org.jclouds.rest.HttpClient was bound.
  at org.jclouds.rest.config.BinderUtils.bindHttpApiProvider(BinderUtils.java:106)

15) No implementation for org.jclouds.cloudfiles.CloudFilesClient was bound.
  at org.jclouds.rest.config.BinderUtils.bindHttpApiProvider(BinderUtils.java:106)

16) No implementation for org.jclouds.openstack.swift.extensions.TemporaryUrlKeyApi was bound.
  at org.jclouds.rest.config.BinderUtils.bindHttpApiProvider(BinderUtils.java:106)

16 errors

我無法弄清楚這一點,因為它幾乎就是示例代碼的第一行......

您使用Java 7u51運行jclouds 1.6.x或1.7.0嗎? 如果是這樣,您可能遇到過https://issues.apache.org/jira/browse/JCLOUDS-427 您可以通過降級到Java 7u45或升級到jclouds 1.7.1來解決這個問題。

暫無
暫無

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

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