The Script Runner is throwing a java.lang.NullPointerException during indexing

This is the exception that occurs when re-indexing is started.

014-01-28 08:06:03,812 IssueIndexer:thread-3 ERROR [onresolve.jira.groovy.GroovyCustomField] javax.script.ScriptException: java.lang.NullPointerException: Cannot invoke method getTime() on null object

javax.script.ScriptException: javax.script.ScriptException: java.lang.NullPointerException: Cannot invoke method getTime() on null object

at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:117)

at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:233)

at javax.script.ScriptEngine$eval$8.call(Unknown Source)

at com.onresolve.jira.groovy.GroovyCustomField.getValueFromIssue(GroovyCustomField.groovy:160)

at com.atlassian.jira.issue.fields.CustomFieldImpl.getValue(CustomFieldImpl.java:404)

at com.atlassian.jira.issue.index.indexers.impl.SortableTextCustomFieldIndexer.addDocumentFields(SortableTextCustomFieldIndexer.java:44)

at com.atlassian.jira.issue.index.indexers.impl.SortableTextCustomFieldIndexer.addDocumentFieldsSearchable(SortableTextCustomFieldIndexer.java:33)

at com.atlassian.jira.issue.index.indexers.impl.AbstractCustomFieldIndexer.addIndex(AbstractCustomFieldIndexer.java:46)

at com.atlassian.jira.issue.index.IssueDocument.getDocument(IssueDocument.java:41)

at com.atlassian.jira.issue.index.DefaultIssueDocumentFactory.get(DefaultIssueDocumentFactory.java:15)

at com.atlassian.jira.issue.index.DefaultIssueDocumentFactory.get(DefaultIssueDocumentFactory.java:11)

at com.atlassian.jira.issue.index.DefaultIssueIndexer$IssueLockDocumentCreationStrategy$2.get(DefaultIssueIndexer.java:606)

at com.atlassian.jira.issue.index.DefaultIssueIndexer$IssueLockDocumentCreationStrategy$2.get(DefaultIssueIndexer.java:601)

at com.atlassian.util.concurrent.ManagedLocks$ManagedLockImpl.withLock(ManagedLocks.java:303)

at com.atlassian.jira.issue.index.DefaultIssueIndexer$IssueLockDocumentCreationStrategy.get(DefaultIssueIndexer.java:600)

at com.atlassian.jira.issue.index.DefaultIssueIndexer$IndexIssuesOperation.perform(DefaultIssueIndexer.java:454)

at com.atlassian.jira.issue.index.DefaultIssueIndexer$4$1.get(DefaultIssueIndexer.java:292)

at com.atlassian.jira.issue.index.DefaultIssueIndexer$4$1.get(DefaultIssueIndexer.java:288)

at com.atlassian.jira.index.SimpleIndexingStrategy.get(SimpleIndexingStrategy.java:9)

at com.atlassian.jira.index.SimpleIndexingStrategy.get(SimpleIndexingStrategy.java:5)

at com.atlassian.jira.index.MultiThreadedIndexingStrategy$1.call(MultiThreadedIndexingStrategy.java:38)

at com.atlassian.jira.index.MultiThreadedIndexingStrategy$1.call(MultiThreadedIndexingStrategy.java:35)

at com.atlassian.jira.util.concurrent.BoundedExecutor$2.call(BoundedExecutor.java:69)

at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)

at java.util.concurrent.FutureTask.run(FutureTask.java:166)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

at java.lang.Thread.run(Thread.java:722)

Caused by: javax.script.ScriptException: java.lang.NullPointerException: Cannot invoke method getTime() on null object

at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:318)

at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:111)

... 27 more

Caused by: java.lang.NullPointerException: Cannot invoke method getTime() on null object

at org.codehaus.groovy.runtime.NullObject.invokeMethod(NullObject.java:77)

at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)

at org.codehaus.groovy.runtime.callsite.NullCallSite.call(NullCallSite.java:32)

at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)

at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:54)

at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)

at Script8.run(Script8.groovy:11)

at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:315)

... 28 more

When I disabled the Script Runner plugin the problem does not occure. Here is some output from the log file atlassian-jira.log:

2014-02-11 09:03:38,985 http-bio-130.4.131.204-8443-exec-16 INFO ht1792 543x10800x1 e232kk 135.16.251.241 /rest/plugins/1.0/com.onresolve.jira.groovy.groovyrunner-key [atlassian.plugin.manager.DefaultPluginManager] Disabling com.onresolve.jira.groovy.groovyrunner

2014-02-11 09:04:25,433 JiraTaskExectionThread-2 INFO ht1792 544x10853x1 e232kk 135.16.251.241 /secure/admin/IndexReIndex.jspa [action.admin.index.IndexAdminImpl] Re-indexing started

2014-02-11 09:04:25,433 JiraTaskExectionThread-2 INFO ht1792 544x10853x1 e232kk 135.16.251.241 /secure/admin/IndexReIndex.jspa [jira.util.index.CompositeIndexLifecycleManager] Reindex All starting...

2014-02-11 09:04:25,434 JiraTaskExectionThread-2 INFO ht1792 544x10853x1 e232kk 135.16.251.241 /secure/admin/IndexReIndex.jspa [action.admin.index.IndexAdminImpl] Re-indexing is 0% complete. Current index: Issue

2014-02-11 09:04:25,434 JiraTaskExectionThread-2 INFO ht1792 544x10853x1 e232kk 135.16.251.241 /secure/admin/IndexReIndex.jspa [jira.issue.index.DefaultIndexManager] Reindexing all issues

2014-02-11 09:04:25,734 IssueIndexer:thread-1 ERROR ht1792 544x10853x1 e232kk 135.16.251.241 /secure/admin/IndexReIndex.jspa [jira.issue.managers.DefaultCustomFieldManager] Could not load custom field type plugin with key 'com.atlassian.jira.plugin.linker:linker'. Is the plugin present and enabled?

2014-02-11 09:04:26,177 IssueIndexer:thread-1 ERROR ht1792 544x10853x1 e232kk 135.16.251.241 /secure/admin/IndexReIndex.jspa [jira.issue.managers.DefaultCustomFieldManager] Could not load custom field type plugin with key 'com.onresolve.jira.groovy.groovyrunner:scripted-field'. Is the plugin present and enabled?

2014-02-11 09:04:26,343 IssueIndexer:thread-1 ERROR ht1792 544x10853x1 e232kk 135.16.251.241 /secure/admin/IndexReIndex.jspa [jira.issue.managers.DefaultCustomFieldManager] Could not load custom field type plugin with key 'com.onresolve.jira.groovy.groovyrunner:jqlFunctionsCustomFieldType'. Is the plugin present and enabled?

2014-02-11 09:04:44,685 IssueIndexer:thread-3 INFO ht1792 544x10853x1 e232kk 135.16.251.241 /secure/admin/IndexReIndex.jspa [action.admin.index.IndexAdminImpl] Re-indexing is 1% complete. Current index: Issue

2014-02-11 09:05:04,102 IssueIndexer:thread-6 INFO ht1792 544x10853x1 e232kk 135.16.251.241 /secure/admin/IndexReIndex.jspa [action.admin.index.IndexAdminImpl] Re-indexing is 2% complete. Current index: Issue

2014-02-11 09:05:23,929 IssueIndexer:thread-8 INFO ht1792 544x10853x1 e232kk 135.16.251.241 /secure/admin/IndexReIndex.jspa [action.admin.index.IndexAdminImpl] Re-indexing is 3% complete. Current index: Issue

We are using JIRA 6.1.5 and Script Runner 2.1.16

1 answer

1 accepted

1 vote
Henning Tietgens Community Champion Feb 16, 2014

You have a scripted field which doesn't handle null values well. Somewhere you call getTime() on a null object. You should doublecheck your scripted field scripts.

Henning

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 May 30, 2018 in Marketplace Apps

Three tips for boosting your board's efficiency with Story Maps

Trello is one of the most effective tools for driving your sprints. It's customizable for every Agile team and product owners and Scrum masters (SM) love it. However, Agile teams often struggle with:...

856 views 2 9
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