0

Got java.lang.NoSuchFieldError: ALLOW_FINAL_FIELDS_AS_MUTATORS when executing the following code segment.

S3Object object = s3Client.getObject(new GetObjectRequest(bucketName, fileName));

InputStream reader = new BufferedInputStream(object.getObjectContent());
File file = new File(filePathToDownload);      
OutputStream writer = new BufferedOutputStream(new FileOutputStream(file));
int read = -1;
while ( ( read = reader.read() ) != -1 ) {
         writer.write(read);
}

writer.flush();
writer.close();
reader.close(); 
Alex
  • 803
  • 4
  • 9

1 Answers1

0

Finally I solved my error by providing proper credential and client configuration in AmazonS3 initialization. Thanks for your support guys.

  • 1
    can you provide a code snippet of how you setup the client configuration? I know it's sort of a noob question but if you can help me out. would be great – Katakam Nikhil Dec 19 '18 at 17:29