Could not find class, check it is under a 'scripts directory': java.lang.ClassNotFoundException

I'm getting below error when i'm trying to add groovy class file under custom listner

JIRA 6.3.7

1 answer

1 accepted

0 votes

Where have you placed the class exactly?  jira-home/???/???/??? etc?


it was working fine before jira upgrade 6.2

Ok, which version of the script runner are you using now? If you've moved from 2.something to 3.something, then the script location handling has changed and you'll need to handle that.

i was on 2.1.17 and moved to 3.0.6 how do i handle it?

Do i need to update with below set JAVA_OPTS=%JAVA_OPTS% -Dplugin.script.roots=//pt/atlassian/jira/atlassian-jira/WEB-INF/classes/com/icg

Hei, well you could copy the class into <jira-home>/scripts/com/icg/ then the class would be accessible from a custom listener as "com.icg.<className>" (please notice the missing '.groovy' extension)

Thanks Jamie, that's where I was headed when I asked about the versions!

Thank you guys. I was able to add those files successfully yesterday however today, when I tried to 'update' listener under 'script listners', it is throwing below error 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 { ^ 1 error

I marked Nic's answer as correct as you've cross-posted this last question.

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 ...

3,145 views 13 19
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