Hi,
I've encountered a weird problem while trying to access an S3 object through my Jira Plugin.
Up until now, the file was stored on the local file system and everything was working properly. After I started developing the function, that's supposed to access the S3 object, the plugin stopped loading. And I am talking about a function that is never called from another piece of code (yet). So I started to investigate where the problem lies and started to uncomment the lines of the function one by one. The plugin was still working with the first one uncommented, but after uncommenting the second line of the function (where the s3Client variable is declared), it refused to load.
Here's the function in question:
static String readS3File(Charset encoding)
{
AWSCredentials myCredentials = new BasicAWSCredentials("XXXX", "YYYY");
AmazonS3 s3Client = AmazonS3ClientBuilder.standard().withCredentials(new AWSStaticCredentialsProvider(myCredentials)).build();
/*S3Object object = s3Client.getObject(new GetObjectRequest("zzz", "aaa.json"));
InputStream reader = new BufferedInputStream(
object.getObjectContent());
StringWriter writer = new StringWriter();
try {
IOUtils.copy(reader, writer, String.valueOf(encoding));
}
catch (Exception e)
{
//not really
}
String result = writer.toString();
//reader.close();*/
return "";
}
If anyone has any idea what's causing this issue, I'll be very thankful.
Kind regards,
Teodor
I finally got it to work and the solution was rather simple - just had to change the aws dependencies from "provided" to "compile" and clean the project.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.