我想要一套新的標記添加到使用AWS的Java API的S3桶,但我得到象這樣的錯誤時:MalformedXML標記的S3存儲
com.amazonaws.services.s3.model.AmazonS3Exception: The XML you provided was not well-formed or did not validate against our published schema (Service: Amazon S3; Status Code: 400; Error Code: MalformedXML; Request ID: 5B3401CBDB133A88), S3 Extended Request ID: z1EDhMH5vN7o/9Tk93K5R1gWmmqUr49WjEz2rovD9HRCGJ54yHBfoTuUURvnpoizlCUK3Fy9qbY=
這是代碼我已經寫了(newTags
是Map<String, String>
):
List<TagSet> tags = amazonS3.getBucketTaggingConfiguration(bucketName).getAllTagSets();
tags.add(new TagSet(newTags));
s3Service.setBucketTaggingConfiguration(bucketName, new BucketTaggingConfiguration(tags));
我還沒有使用XML自己,錯誤是無益的,什麼是實際發生錯誤。發生什麼事?