Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Plugin doesn't run after uncommenting unused code

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

1 answer

1 accepted

0 votes
Answer accepted

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.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Software

How to create Jira issus from Excel file?

When to use CSV importer When managing your processes in Jira, there are many occasions where you need to create a lot of tasks. Creating them one by one will cost you a lot of time and effort and i...

4,528 views 22 32
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you