I am trying to enable versioning for Amazon S3 bucket using Java. But, I am not able to do. I get an exception
"Exception Status Code: 400, AWS Request ID: DC53C8220CEC7D4C, AWS Error Code: MalformedXML, AWS Error Message: The XML you provided was not well-formed or did not validate against our published schema, S3 Extended Request ID: qAdibjSkoFltjoYTFZSdTOnh8JXwZrxkjgrTcgaXqZYGIgVdbRxr8VXzwkO4ilaG"
Can somebody please point out the error in the code. I am attaching the portion of the code responsible for enabling bucket versioning.
public void enableVersioning(String bucketName) {
SetBucketVersioningConfigurationRequest request =
new SetBucketVersioningConfigurationRequest(bucketName,
new BucketVersioningConfiguration("ENABLED"));
AmazonS3 s3 = new AmazonS3Client(credentials); // I have the credentials
s3.setBucketVersioningConfiguration(request);
}
Thanks in advance.