开发者社区> 问答> 正文

生成oss对象访问url异常

通过sts方式生成oss文件访问url
String accessKeyId1 = response.getCredentials().getAccessKeyId();
String accessKeySecret1 = response.getCredentials().getAccessKeySecret();
String securityToken = response.getCredentials().getSecurityToken();

String endpoint = "http://oss-cn-beijing.aliyuncs.com";
/ 上边都成功获取到了*/
OSSClient client = new OSSClient(endpoint, accessKeyId1, accessKeySecret1, securityToken);
到这行的时候抛出异常
java.lang.NoSuchFieldError: INSTANCE
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.(SSLConnectionSocketFactory.java:144)
at com.aliyun.oss.common.comm.DefaultServiceClient.createHttpClientConnectionManager(DefaultServiceClient.java:232)

at com.aliyun.oss.common.comm.DefaultServiceClient.<init>(DefaultServiceClient.java:78)
at com.aliyun.oss.OSSClient.<init>(OSSClient.java:273)
at com.aliyun.oss.OSSClient.<init>(OSSClient.java:211)

展开
收起
111fdfdfdf 2016-08-20 21:15:52 5104 0
1 条回答
写回答
取消 提交回答
  • 已解决了,依赖jar包有冲突,更换高版本后成功

    2019-07-17 20:04:34
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
OSS运维进阶实战手册 立即下载
《OSS运维基础实战手册》 立即下载
OSS运维基础实战手册 立即下载