jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zrealyi <notificati...@github.com>
Subject Re: [jclouds/jclouds] JCLOUDS-1258 S3 China Beijing Region Support (#1081)
Date Fri, 14 Apr 2017 04:09:39 GMT
Asking for help.
I have compiled the newest jclouds within supporting the china region  for aws-s3. And I code
an example program to accessing the aws-s3. But there is an error when I call the method named
blobStore.createContainerInLocation(location, "awss3buket2") that the location's id is "cn-north-1".
The error information is "Cannot retry after server error, command has exceeded retry limit
5: [method=org.jclouds.aws.s3.AWSS3Client.public abstract boolean org.jclouds.s3.S3Client.putBucketInRegion(java.lang.String,java.lang.String,org.jclouds.s3.options.PutBucketOptions[])[cn-north-1,
awss3buket2, [Lorg.jclouds.s3.options.PutBucketOptions;@690d681a], request=PUT https://awss3buket2.s3.amazonaws.com/
HTTP/1.1]". 
*********************************** code detail *************************
static final String AWSS3_ENDPOINT = "https://s3.cn-north-1.amazonaws.com.cn";
static final String LOCATION_CN = "cn-north-1";
 BlobStoreContext context= ContextBuilder.newBuilder("aws-s3")
                .credentials(AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY)
                .endpoint(AWSS3_ENDPOINT)
               .buildView(AWSS3BlobStoreContext.class);
BlobStore blobStore = context.getBlobStore();
Location locationCN = Iterables.getLast(blobStore.listAssignableLocations(), null);
for(Location location : blobStore.listAssignableLocations()){
       System.out.println(location.getDescription()+":"+location.getId()+":"+location.getScope());
        if(LOCATION_CN.equalsIgnoreCase(location.getId())){
        	locationCN = location;
        	break;
        }
}
System.out.println("-->"+locationCN.getDescription());
System.out.println(blobStore.containerExists( "awss3buket2"));
blobStore.createContainerInLocation(locationCN, "awss3buket2");
context.close();

********************************* output ******************************
Hello World!
us-standard:us-standard:REGION
us-east-2:us-east-2:REGION
us-west-1:us-west-1:REGION
us-west-2:us-west-2:REGION
ca-central-1:ca-central-1:REGION
eu-west-1:eu-west-1:REGION
eu-west-2:eu-west-2:REGION
eu-central-1:eu-central-1:REGION
sa-east-1:sa-east-1:REGION
ap-southeast-1:ap-southeast-1:REGION
ap-southeast-2:ap-southeast-2:REGION
ap-south-1:ap-south-1:REGION
ap-northeast-1:ap-northeast-1:REGION
ap-northeast-2:ap-northeast-2:REGION
cn-north-1:cn-north-1:REGION
-->cn-north-1
false
4月 14, 2017 11:59:04 上午 org.jclouds.logging.jdk.JDKLogger logError
严重: Cannot retry after server error, command has exceeded retry limit 5: [method=org.jclouds.aws.s3.AWSS3Client.public
abstract boolean org.jclouds.s3.S3Client.putBucketInRegion(java.lang.String,java.lang.String,org.jclouds.s3.options.PutBucketOptions[])[cn-north-1,
awss3buket2, [Lorg.jclouds.s3.options.PutBucketOptions;@690d681a], request=PUT https://awss3buket2.s3.amazonaws.com/
HTTP/1.1]
Exception in thread "main" org.jclouds.http.HttpResponseException: Connection timed out: connect
connecting to PUT https://awss3buket2.s3.amazonaws.com/ HTTP/1.1
	at org.jclouds.http.internal.BaseHttpCommandExecutorService.invoke(BaseHttpCommandExecutorService.java:122)
	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.$Proxy42.putBucketInRegion(Unknown Source)
	at org.jclouds.s3.blobstore.S3BlobStore.createContainerInLocation(S3BlobStore.java:454)
	at org.jclouds.aws.s3.blobstore.AWSS3BlobStore.createContainerInLocation(AWSS3BlobStore.java:105)
	at org.jclouds.s3.blobstore.S3BlobStore.createContainerInLocation(S3BlobStore.java:146)
	at inspur.jclouds.example.App.main(App.java:52)
Caused by: java.net.ConnectException: Connection timed out: connect
	at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
	at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:97)
	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:370)
	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:231)
	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:213)
	at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:192)
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:404)
	at java.net.Socket.connect(Socket.java:643)
	at com.ibm.jsse2.aq.connect(aq.java:506)
	at sun.net.NetworkClient.doConnect(NetworkClient.java:188)
	at sun.net.www.http.HttpClient.openServer(HttpClient.java:462)
	at sun.net.www.http.HttpClient.openServer(HttpClient.java:557)
	at com.ibm.net.ssl.www2.protocol.https.c.<init>(c.java:93)
	at com.ibm.net.ssl.www2.protocol.https.c.a(c.java:185)
	at com.ibm.net.ssl.www2.protocol.https.d.getNewHttpClient(d.java:35)
	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:989)
	at com.ibm.net.ssl.www2.protocol.https.d.connect(d.java:3)
	at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1104)
	at com.ibm.net.ssl.www2.protocol.https.b.getOutputStream(b.java:39)
	at org.jclouds.http.internal.JavaUrlHttpCommandExecutorService.writePayloadToConnection(JavaUrlHttpCommandExecutorService.java:295)
	at org.jclouds.http.internal.JavaUrlHttpCommandExecutorService.convert(JavaUrlHttpCommandExecutorService.java:171)
	at org.jclouds.http.internal.JavaUrlHttpCommandExecutorService.convert(JavaUrlHttpCommandExecutorService.java:65)
	at org.jclouds.http.internal.BaseHttpCommandExecutorService.invoke(BaseHttpCommandExecutorService.java:99)
	... 10 more

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/1081#issuecomment-294081263
Mime
View raw message