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 vote

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 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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Sunday in Agility

You asked for it, so we delivered: images on issues have arrived

A picture tells a thousand words. And agility boards have just released their latest feature: cover images on issues – so now your board can tell a story at first glance. Upload attachmen...

532 views 3 11
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