Invalid duplicate class definition of class

Problem loading class: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: /var/atlassian/application-data/jira/scripts/com/icg/UpdateSummary.groovy: 9: Invalid duplicate class definition of class UpdateSummary : The sources /var/atlassian/application-data/jira/scripts/com/icg/UpdateSummary.groovy and file:/var/atlassian/application-data/jira/scripts/com/icg/UpdateSummary.groovy each contain a class with the name UpdateSummary. @ line 9, column 1. class UpdateSummary extends AbstractIssueEventListener

3 answers

0 votes

Do you have any links on the file or is it duplicated in some way?  Has the file got the same class named twice?

0 votes

It's generally because you have a class with code outside the class, so the compiler generates a class for the class in the file, and a script class with the same name, eg this will cause it if a file called Foo.groovy.

class Foo {}

new Foo()

I don't have anything new Class_Name() in the file. This is working without any issue on 6.2 & script listner 2.1.17 When I did upgrade on staging, this issue started. I have copied my groovy files from /opt/... to /var/... I was able to update those successfully if I do Jira restart. However if i try to do update script runner files next day, it throws same error.

I'm using below line- Logger log = Logger.getLogger(AddReporterAsWatcher.class) I hope this will not cause any issue. Do i need to delete files from old path?

also if i keep those files under /var/atlassian/applicaiton-data/jira/scripts it does not throw mentioned. as of not those i are kept in /var/atalassian/applicaiton-data/jira/scripts/com/icg/

It depends what the package name in the class is... what is it? They should only be there once in the script root.

more details>> restart jira >> add/update custom listner files >> no duplicate class error create a jira issue which meets condition in the class file now again >> add/update custom listner files >> duplicate class name error if i do restart then it does not throw error conditionally ticket has not been created after restart

> Do i need to delete files from old path? Probably, yes.

Rename the file to some other name, dont keep class name and file name same ! will solve the problem.

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,755 views 11 18
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot