下面是创建存储空间中报的异常,
这里BucketInfo info = ossClient.getBucketInfo(bucketName);报的异常,下面是异常信息,大家看下。
com.aliyun.oss.OSSException: The bucket you visit is not belong to you.
[ErrorCode]: AccessDenied
[RequestId]: 5BEBEFBECE65897ED51E07C7
[HostId]: crowd.oss-cn-beijing.aliyuncs.com
[ResponseError]:
<?xml version="1.0" encoding="UTF-8"?>
<Error>
<Code>AccessDenied</Code>
<Message>The bucket you visit is not belong to you.</Message>
<RequestId>5BEBEFBECE65897ED51E07C7</RequestId>
<HostId>crowd.oss-cn-beijing.aliyuncs.com</HostId>
</Error>
at com.aliyun.oss.common.utils.ExceptionFactory.createOSSException(ExceptionFactory.java:99)
at com.aliyun.oss.internal.OSSErrorResponseHandler.handle(OSSErrorResponseHandler.java:69)
at com.aliyun.oss.common.comm.ServiceClient.handleResponse(ServiceClient.java:248)
at com.aliyun.oss.common.comm.ServiceClient.sendRequestImpl(ServiceClient.java:130)
at com.aliyun.oss.common.comm.ServiceClient.sendRequest(ServiceClient.java:68)
at com.aliyun.oss.internal.OSSOperation.send(OSSOperation.java:94)
at com.aliyun.oss.internal.OSSOperation.doOperation(OSSOperation.java:149)
at com.aliyun.oss.internal.OSSOperation.doOperation(OSSOperation.java:113)
at com.aliyun.oss.internal.OSSBucketOperation.getBucketInfo(OSSBucketOperation.java:1212)
at com.aliyun.oss.OSSClient.getBucketInfo(OSSClient.java:1203)
at com.aliyun.oss.OSSClient.getBucketInfo(OSSClient.java:1197)
at com.aliyun.oss.demo.HelloOSS.main(HelloOSS.java:93)
$accessKeyId = "<yourAccessKeyId>";
$accessKeySecret = "<yourAccessKeySecret>";
// Endpoint以杭州为例,其它Region请按实际情况填写。
$endpoint = "http://oss-cn-hangzhou.aliyuncs.com";
// 存储空间名称。
$bucket= "<yourBucketName>";
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。