aliyun / aliyun-oss-java-sdk

Aliyun OSS SDK for Java
1.22k stars 805 forks source link

本地上传可以 为什么发服务器就报错呢? #546

Closed dayuange123 closed 1 month ago

dayuange123 commented 1 month ago

com.aliyun.oss.ClientException: Connection error due to: Connection pool shut down

at com.aliyun.oss.common.comm.ServiceClient.sendRequestImpl(ServiceClient.java:172)
at com.aliyun.oss.common.comm.ServiceClient.sendRequest(ServiceClient.java:71)
at com.aliyun.oss.internal.OSSOperation.send(OSSOperation.java:134)
at com.aliyun.oss.internal.OSSOperation.doOperation(OSSOperation.java:192)
at com.aliyun.oss.internal.OSSOperation.doOperation(OSSOperation.java:153)
at com.aliyun.oss.internal.OSSObjectOperation.writeObjectInternal(OSSObjectOperation.java:1195)
at com.aliyun.oss.internal.OSSObjectOperation.putObject(OSSObjectOperation.java:130)
at com.aliyun.oss.OSSClient.putObject(OSSClient.java:612)
at com.zhangkaixu.secret.party.basic.sinking.resources.infrastructure.acl.AliyunCosConfigService.uploadFile(AliyunCosConfigService.java:84)
at com.zhangkaixu.secret.party.basic.sinking.resources.infrastructure.ResourceUploadServiceProvider.uploadResource(ResourceUploadServiceProvider.java:52)
at com.zhangkaixu.secret.party.basic.sinking.resources.applic
woxinfeixiang233 commented 1 month ago

这是来自QQ邮箱的假期自动回复邮件。   您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。

dayuange123 commented 1 month ago

`OssProperties.Aliyun aliyun = ossProperties.getAliyun(); STSAssumeRoleSessionCredentialsProvider credentialsProvider = CredentialsProviderFactory.newSTSAssumeRoleSessionCredentialsProvider( aliyun.getRegionId(), aliyun.getAccessKey(), aliyun.getSecretKey(), aliyun.getRoleArn());

    // 创建ClientBuilderConfiguration实例。
    ClientBuilderConfiguration conf = new ClientBuilderConfiguration();

    // 创建OSSClient实例。
    this.ossClient = new OSSClientBuilder().build(aliyun.getEndpoint(), credentialsProvider, conf);`
dayuange123 commented 1 month ago
        PutObjectRequest putObjectRequest = new PutObjectRequest(bucketName, key, inputStream);
        // 上传文件。
        PutObjectResult result = ossClient.putObject(putObjectRequest);
dayuange123 commented 1 month ago

好像是刚发布上去可以 ,过一段时间就坏了