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 vote

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 vote

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 Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Tuesday in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

243 views 1 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