2016-09-30 8 views
1

BluemixのObject Storageサービスに接続するのは難しいです。しかし、私は例外を取得し続けます。ここに私のコードは次のとおりです。ObjectStore Bluemix connection java

public static void main(String[] args){ 
    SwiftApi swiftApi; 

    String endpoint = "https://identity.open.softlayer.com/v2.0"; 
    String tenantName = "object_storage_aedba606_1c69_4a54_b12c_2cecxxxxxx"; 
    String userName = "e8ee36a1fa38432abcxxxxxxx"; 
    String password = "Y6R(cY3xxxxxxxx"; 
    String identity = tenantName+":"+userName; 
    String provider = "openstack-swift"; 
    String region = "dallas"; 
     Properties overrides=new Properties(); 
     overrides.setProperty(Constants.PROPERTY_LOGGER_WIRE_LOG_SENSITIVE_INFO, "true"); 
    swiftApi = ContextBuilder.newBuilder(provider) 
      .endpoint(endpoint) 
      .credentials(identity, password) 
      .overrides(overrides) 
      .buildApi(SwiftApi.class); 

    System.out.println("List Containers"); 

    ContainerApi containerApi = swiftApi.getContainerApi(region); 
    Set<Container> containers = containerApi.list().toSet(); 

    System.out.println("Listing Containers: "); 

    for (Container container : containers) { 
     System.out.println(" " + container); 
    } 
    System.out.println(" "); 
} 

私は次の例外を取得しておいてください。

Exception in thread "main" org.jclouds.rest.AuthorizationException: request: 
POST https://identity.open.softlayer.com/v2.0/tokens HTTP/1.1 [Sensitive data in payload, 
use PROPERTY_LOGGER_WIRE_LOG_SENSITIVE_INFO override to enable logging this data.] 
failed with response: HTTP/1.1 401 Unauthorized 
    at org.jclouds.openstack.swift.v1.handlers.SwiftErrorHandler.handleError 
(SwiftErrorHandler.java:52) 
    at org.jclouds.http.handlers.DelegatingErrorHandler.handleError 
(DelegatingErrorHandler.java:65) 
    at org.jclouds.http.internal.BaseHttpCommandExecutorService.shouldContinue 
(BaseHttpCommandExecutorService.java:136) 

私のアプリケーションは、スタンドアロンのJavaアプリケーションです。 Bluemixのオブジェクトストレージサービスで提供されている資格情報を使用しています。

ご協力いただきまして誠にありがとうございます。

答えて

1
+0

感謝を使用して、オブジェクトストレージにアクセスすることができますBluemixでストレージをオブジェクトに接続するのに役立ちます、私は、jclouds実装を落とし、代わりにOpenStack4Jを使用して終了しました上記の答えに記載されています。それは残念ですが、私は物事を働かせる唯一の方法です。再度、感謝します – jdcalus

関連する問題