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

This widget could not be displayed.

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

/opt/atlassian/jira/atlassian-jira/WEB-INF/classes/com/icg

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 setenv.sh 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, this worked.

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 Sign up to answer
Community showcase
Published Friday in Jira

New 5k User Limit and Other Cloud Updates

Hi all! Lauren here from the Enterprise Cloud marketing team.  I have some exciting Cloud updates from #AtlassianSummit that I wanted to share. We want everyone in your organization to be ab...

102 views 0 3
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