开发者社区> 问答> 正文

SDK初始化报错

初始化报错:
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
        The method loadTrustMaterial(KeyStore, TrustStrategy) in the type SSLContextBuilder is not applicable for the arguments (null, new TrustStrategy(){})

        at com.aliyun.oss.common.comm.DefaultServiceClient.create HttpClientConnectionManager(DefaultServiceClient.java:230)
        at com.aliyun.oss.common.comm.DefaultServiceClient.<init>(DefaultServiceClient.java:85)
        at com.aliyun.oss.OSSClient.<init>(OSSClient.java:209)
        at com.aliyun.oss.OSSClient.<init>(OSSClient.java:129)
        at com.driver.oss.OssClient.<init>(OssClient.java:44)
        at com.driver.oss.OssClient.main(OssClient.java:167)


        对应的代码如下:
        The method loadTrustMaterial(KeyStore, TrustStrategy) in the type SSLContextBuilder is not applicable for the arguments (null, new TrustStrategy(){})

        at com.aliyun.oss.common.comm.DefaultServiceClient.create HttpClientConnectionManager(DefaultServiceClient.java:230)
        at com.aliyun.oss.common.comm.DefaultServiceClient.<init>(DefaultServiceClient.java:85)
        at com.aliyun.oss.OSSClient.<init>(OSSClient.java:209)
        at com.aliyun.oss.OSSClient.<init>(OSSClient.java:129)
        at com.driver.oss.OssClient.<init>(OssClient.java:44)
        at com.driver.oss.OssClient.main(OssClient.java:167)

展开
收起
wpz 2018-01-07 19:43:28 2884 0
1 条回答
写回答
取消 提交回答
  • wpz
    ReSDK初始化报错
    谁帮个忙?

    -------------------------

    ReSDK初始化报错
    真来火,发布一个SDK,也不好好测一测,就丢出来,还用那么高版本的jar,这不是在害人吗?

    -------------------------

    ReSDK初始化报错
    真没法用,一堆的红叉,竟然能跑起来,这哪是是在做产品啊?

    -------------------------

    ReSDK初始化报错
    为什么这个方法是过时的呢?
    getObjectName()

        /**
         * Options object.
         */
        public ResponseMessage optionsObject(OptionsRequest optionsRequest) {
            
            assertParameterNotNull(optionsRequest, "optionsRequest");
            
            String bucketName = optionsRequest.getBucketName();
            assertParameterNotNull(bucketName, "bucketName");
            ensureBucketNameValid(bucketName);
            
            @SuppressWarnings("deprecation")
            RequestMessage request = new OSSRequestMessageBuilder(getInnerClient())
                    .setEndpoint(getEndpoint())
                    .setMethod(HttpMethod.OPTIONS)
                    .setBucket(bucketName)
                    .setKey(optionsRequest.getObjectName())
                    .addHeader(OSSHeaders.ORIGIN, optionsRequest.getOrigin())
                    .addHeader(OSSHeaders.ACCESS_CONTROL_REQUEST_METHOD, optionsRequest.getRequestMethod().name())
                    .addHeader(OSSHeaders.ACCESS_CONTROL_REQUEST_HEADER, optionsRequest.getRequestHeaders())
                    .setOriginalRequest(optionsRequest)
                    .build();
            
            return doOperation(request, emptyResponseParser, bucketName, null);
        }
    2018-01-07 19:49:30
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
从 SDK 到编解码:视频直播架构解析 立即下载
跨平台的云服务SDK需要什么 立即下载
一个跨平台的云服务SDK需要什么 立即下载