判断bucket我用doesBucketExist方法判断,bucket是我随意写的,肯定是不存在的,报这个错
Exception in thread "main" com.aliyun.openservices.ClientException: 服务器返回未知错误。
at com.aliyun.openservices.oss.internal.OSSExceptionFactory.createInvalidResponseException(OSSExceptionFactory.java:28)
at com.aliyun.openservices.oss.internal.OSSErrorResponseHandler.handle(OSSErrorResponseHandler.java:41)
at com.aliyun.common.comm.ServiceClient.handleResponse(ServiceClient.java:284)
at com.aliyun.common.comm.ServiceClient.sendRequestImpl(ServiceClient.java:177)
at com.aliyun.common.comm.ServiceClient.sendRequest(ServiceClient.java:136)
at com.aliyun.openservices.oss.internal.OSSOperation.send(OSSOperation.java:60)
at com.aliyun.openservices.oss.internal.OSSBucketOperation.getBucketAcl(OSSBucketOperation.java:190)
at com.aliyun.openservices.oss.internal.OSSBucketOperation.bucketExists(OSSBucketOperation.java:240)
at com.aliyun.openservices.oss.OSSClient.doesBucketExist(OSSClient.java:271)
at cc.oscs.OSSObjectSample.main(OSSObjectSample.java:53)
Caused by: com.aliyun.common.parser.ResultParseException: 返回结果无效,无法解析。
at com.aliyun.common.parser.JAXBResultParser.getObject(JAXBResultParser.java:72)
at com.aliyun.openservices.oss.internal.OSSErrorResponseHandler.handle(OSSErrorResponseHandler.java:38)
... 8 more
Caused by: javax.xml.bind.UnmarshalException
- with linked exception:
[org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; 前言中不允许有内容。]
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.createUnmarshalException(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.createUnmarshalException(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(Unknown Source)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(Unknown Source)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(Unknown Source)
at com.aliyun.common.parser.JAXBResultParser.getObject(JAXBResultParser.java:70)
... 9 more
Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; 前言中不允许有内容。
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
... 14 more
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。