您现在的位置是:网站首页 > 代码编程 > JAVA开发JAVA开发
【原】阿里云OSS上传文件出错“The bucket you are attempting to access must be addressed using the specified endpoint”
不忘初心 2020-01-09 围观() 评论() 点赞() 【JAVA开发】
简介:这两天建了一个新项目需要用oss,所以在创建了新的bucket之后,就直接将原来项目中的配置拷贝过来,结果分分钟报错:“The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.”,详
这两天建了一个新项目需要用oss,所以在创建了新的bucket之后,就直接将原来项目中的配置拷贝过来,结果分分钟报错:“The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.”,
详细错误信息如下:
com.aliyun.oss.OSSException: The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.
[ErrorCode]: AccessDenied
[RequestId]: 5DF9E1F5EB0E623731F77819
[HostId]: quartet-pay.oss-cn-shanghai.aliyuncs.com
[ResponseError]:
<?xml version="1.0" encoding="UTF-8"?>
<Error>
<Code>AccessDenied</Code>
<Message>The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.</Message>
<RequestId>5DF9E1F5EB0E623731F77819</RequestId>
<HostId>quartet-pay.oss-cn-shanghai.aliyuncs.com</HostId>
<Bucket>quartet-pay</Bucket>
<Endpoint>oss-cn-beijing.aliyuncs.com</Endpoint>
</Error>
at com.aliyun.oss.common.utils.ExceptionFactory.createOSSException(ExceptionFactory.java:100)
at com.aliyun.oss.internal.OSSErrorResponseHandler.handle(OSSErrorResponseHandler.java:70)
at com.aliyun.oss.common.comm.ServiceClient.handleResponse(ServiceClient.java:257)
at com.aliyun.oss.common.comm.ServiceClient.sendRequestImpl(ServiceClient.java:140)
at com.aliyun.oss.common.comm.ServiceClient.sendRequest(ServiceClient.java:70)
at com.aliyun.oss.internal.OSSOperation.send(OSSOperation.java:83)
at com.aliyun.oss.internal.OSSOperation.doOperation(OSSOperation.java:145)
at com.aliyun.oss.internal.OSSOperation.doOperation(OSSOperation.java:102)
at com.aliyun.oss.internal.OSSObjectOperation.writeObjectInternal(OSSObjectOperation.java:1125)
at com.aliyun.oss.internal.OSSObjectOperation.putObject(OSSObjectOperation.java:130)
at com.aliyun.oss.OSSClient.putObject(OSSClient.java:494)
at com.aliyun.oss.OSSClient.putObject(OSSClient.java:478)
at com.aliyun.oss.OSSClient.putObject(OSSClient.java:472)
at com.wolffy.util.OssUtil.upload(OssUtil.java:74)
at com.wolffy.util.OssUtil.main(OssUtil.java:192)
Process finished with exit code 0
一脸懵逼,仔细检查之后,发现是因为point地址写错了。。。
在创建了bucket之后,oss会根据选择的区域自动分配endpoint,我之前新建的bucket选择的是上海,而这个quartet-pay我选择的是北京,所以endpoint应该是oss-cn-beijing.aliyuncs.com,而不应该是oss-cn-shanghai.aliyuncs.com。
看完文章,有任何疑问,请加入群聊一起交流!!!
很赞哦! ()
相关文章
- 阿里云oss上传文件,报错“java.lang.ClassNotFoundException: org.jdom.input.JDOMParseException”
- OSS如何上传文件到Bucket下的子目录中
- 分享一个简单的七牛云资源上传工具类
- 阿里云oss字体文件跨域问题解决方案
- 利用qshell批量导出七牛云中存储的图片和资源
- IntelliJ IDEA 2024.2发布之后强推新UI,如何恢复老的经典UI界面
- Uninstall hasn't detected folder of intelli] lDEA installation. Probablyuninstall.exe was moved from the installation folder.
- 公众号CPS变现新宠:微赚淘客查券返利机器人,开启智能省钱赚钱新时代
- 高返利优惠券公众号推荐
- 返利公众号可信吗安全吗?返利机器人哪个佣金高?
标签云
猜你喜欢
- IntelliJ IDEA 2019.2已经可以利用补丁永久破解激活了
- IntelliJ IDEA 2019.3利用补丁永久破解激活教程
- IntelliJ IDEA高版本最灵活的永久破解激活方法(含插件激活,时长你说了算)
- Jetbrains全家桶基于ja-netfilter的最新破解激活详细图文教程
- IntelliJ IDEA 2022.1永久破解激活教程(亲测可用,持续更新)
- 分享几个正版 IntelliJ IDEA 激活码(破解码、注册码),亲测可用,持续更新
- ja-netfilter到底需不需要mymap,2021.3.2版本激活失效?
- 如何激活idea2022.1及以上版本中的插件(亲测可用)
- 【史上最全】IntelliJ IDEA最新2022.1版本安装和激活视频教学(含插件)
- IntelliJ IDEA 2022.2 版本最新2099年永久激活方法,亲测可用,也可以开启新UI了。
站点信息
- 网站程序:spring + freemarker
- 主题模板:《今夕何夕》
- 文章统计:篇文章
- 标签管理:标签云
- 微信公众号:扫描二维码,关注我们