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?

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.

that did not help.

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
Community showcase
Published Nov 29, 2018 in Jira

How to set up an incident workflow from the VP of Engineering at Sentry

Hey Atlassian community, I help lead engineering at Sentry, an open-source error-tracking and monitoring tool that integrates with Jira. We started using Jira Software Cloud internally last year, a...

1,082 views 0 8
Read article

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