获取ailiyun图片上传报错:
2018-05-10 18:48:00.601 [http-nio-8080-exec-2] INFO org.apache.http.impl.execchain.RetryExec - Retrying request to {s}->https://sts.aliyuncs.com:443
2018-05-10 18:48:00.602 [http-nio-8080-exec-2] DEBUG org.apache.http.client.protocol.RequestAddCookies - CookieSpec selected: default
2018-05-10 18:48:00.602 [http-nio-8080-exec-2] DEBUG org.apache.http.client.protocol.RequestAuthCache - Auth cache not set in the context
2018-05-10 18:48:00.602 [http-nio-8080-exec-2] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager - Connection request: [route: {s}->https://sts.aliyuncs.com:443][total kept alive: 0; route allocated: 0 of 5; total allocated: 0 of 64]
2018-05-10 18:48:00.602 [http-nio-8080-exec-2] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager - Connection leased: [id: 14][route: {s}->https://sts.aliyuncs.com:443][total kept alive: 0; route allocated: 1 of 5; total allocated: 1 of 64]
2018-05-10 18:48:00.602 [http-nio-8080-exec-2] DEBUG org.apache.http.impl.execchain.MainClientExec - Opening connection {s}->https://sts.aliyuncs.com:443
2018-05-10 18:48:00.602 [http-nio-8080-exec-2] DEBUG org.apache.http.impl.conn.DefaultManagedHttpClientConnection - http-outgoing-14: Shutdown connection
2018-05-10 18:48:00.602 [http-nio-8080-exec-2] DEBUG org.apache.http.impl.execchain.MainClientExec - Connection discarded
2018-05-10 18:48:00.602 [http-nio-8080-exec-2] DEBUG org.apache.http.impl.conn.DefaultManagedHttpClientConnection - http-outgoing-14: Close connection
2018-05-10 18:48:00.603 [http-nio-8080-exec-2] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager - Connection released: [id: 14][route: {s}->https://sts.aliyuncs.com:443][total kept alive: 0; route allocated: 0 of 5; total allocated: 0 of 64]
2018-05-10 18:48:00.603 [http-nio-8080-exec-2] INFO org.apache.http.impl.execchain.RetryExec - I/O exception (org.apache.http.conn.UnsupportedSchemeException) caught when processing request to {s}->https://sts.aliyuncs.com:443: https protocol is not supported
2018-05-10 18:48:00.603 [http-nio-8080-exec-2] DEBUG org.apache.http.impl.execchain.RetryExec - https protocol is not supported
org.apache.http.conn.UnsupportedSchemeException: https protocol is not supported
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:108)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:107)
at com.aliyuncs.http.clients.ApacheHttpClient.syncInvoke(ApacheHttpClient.java:243)
at com.aliyuncs.DefaultAcsClient.doAction(DefaultAcsClient.java:272)
com.aliyuncs.exceptions.ClientException: SDK.ServerUnreachable
原因:
之前的的JAR .
<dependency>
<groupId>com.aliyun.oss</groupId>
<artifactId>aliyun-sdk-oss</artifactId>
<version>2.8.1</version>
</dependency>
<dependency>
<groupId>com.aliyun</groupId><artifactId>aliyun-java-sdk-core</artifactId>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-dysmsapi</artifactId>
<version>1.1.0</version>
</dependency>
改为:
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-core</artifactId>
<version>3.3.1</version>
</dependency>
<dependency>
<groupId>com.aliyun.oss</groupId>
<artifactId>aliyun-sdk-oss</artifactId>
<version>2.8.3</version>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-dysmsapi</artifactId>
<version>1.0.0</version>
</dependency>