java.lang.NullPointerException: Cannot invoke method getRestriction() on null object

JIRA | Oleksii Gnatkevych | 2 years ago
  1. 0

    {panel:title=*This issue has moved*} {color:red}This issue has been moved permanently to [Adaptavist's Product Support JIRA instance|https://productsupport.adaptavist.com/browse/GRV-721].{color} All existing users of this instance should have the same username on our Product Support instance. However, you will very likely need to click on the [Can't access your account|https://productsupport.adaptavist.com/secure/ForgotLoginDetails.jspa] link in order to reset to a new password. {panel}Hi Jamie Looks like a bug in the WorkflowUtils.groovy examineConditions(). I created a listener to auto-transition issue on comment, using the already existing fast-transition listener, and it threw an error: 2015-05-26 17:11:12,638 Thread-40924 WARN cust_KLUG14 1031x18532x1 8jqbfn 162.49.177.29 /rest/servicedesk/1/servicedesk/customer/comment [canned.jira.utils.WorkflowUtils] Failed to examine exactly why the transition failed. This exception is thrown for debugging purposes, and does not affect why the transition failed. JIRA said no, but we couldn't work out why. java.lang.NullPointerException: Cannot invoke method getRestriction() on null object at org.codehaus.groovy.runtime.NullObject.invokeMethod(NullObject.java:88) at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:45) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45) at org.codehaus.groovy.runtime.callsite.NullCallSite.call(NullCallSite.java:32) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45) at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:54) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112) at com.onresolve.scriptrunner.canned.jira.utils.WorkflowUtils$_examineConditions_closure2.doCall(WorkflowUtils.groovy:241) <+3> (NativeMethodAccessorImpl.java:62) (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324) at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:278) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1016) at groovy.lang.Closure.call(Closure.java:423) at groovy.lang.Closure.call(Closure.java:439) at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1379) at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1372) at org.codehaus.groovy.runtime.dgm$149.invoke(Unknown Source) at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:271) at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116) at com.onresolve.scriptrunner.canned.jira.utils.WorkflowUtils.examineConditions(WorkflowUtils.groovy:236) at com.onresolve.scriptrunner.canned.jira.utils.WorkflowUtils$examineConditions$1.callStatic(Unknown Source) at com.onresolve.scriptrunner.canned.jira.utils.WorkflowUtils.actionIssueWithFeedBack(WorkflowUtils.groovy:120) <+3> (NativeMethodAccessorImpl.java:62) (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324) at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.invoke(StaticMetaMethodSite.java:43) at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.call(StaticMetaMethodSite.java:88) at com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.FasttrackTransition.doTransition(FasttrackTransition.groovy:147) at com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.FasttrackTransition.this$2$doTransition(FasttrackTransition.groovy) <+3> (NativeMethodAccessorImpl.java:62) (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) Also I found that examineConditions explicitly has: def action = workflowDescriptor.getAction(4) RestrictionDescriptor restriction = action.getRestriction(); and 4 is an ID for the default 'Start Progress' transition, but not of the action configured in the listener itself. Looks like a definite bug. Also, two things missing, which would be very nice to have. First, not always user who generated event has the 'transition issue' permission. Would be nice specify an account for the user performing auto-transition, to override it. The second problem is (not sure how to 'fix' it), that action id configured for the workflow, and workflow may change (copy workflow, update, reapply), and then the listeners have to be udpated. I see that it is a very complex question, how to 'tell' it which transition to perform. but anyway, worth mentionning :) Cheers, Oles

    JIRA | 2 years ago | Oleksii Gnatkevych
    java.lang.NullPointerException: Cannot invoke method getRestriction() on null object
  2. 0

    {panel:title=*This issue has moved*} {color:red}This issue has been moved permanently to [Adaptavist's Product Support JIRA instance|https://productsupport.adaptavist.com/browse/GRV-721].{color} All existing users of this instance should have the same username on our Product Support instance. However, you will very likely need to click on the [Can't access your account|https://productsupport.adaptavist.com/secure/ForgotLoginDetails.jspa] link in order to reset to a new password. {panel}Hi Jamie Looks like a bug in the WorkflowUtils.groovy examineConditions(). I created a listener to auto-transition issue on comment, using the already existing fast-transition listener, and it threw an error: 2015-05-26 17:11:12,638 Thread-40924 WARN cust_KLUG14 1031x18532x1 8jqbfn 162.49.177.29 /rest/servicedesk/1/servicedesk/customer/comment [canned.jira.utils.WorkflowUtils] Failed to examine exactly why the transition failed. This exception is thrown for debugging purposes, and does not affect why the transition failed. JIRA said no, but we couldn't work out why. java.lang.NullPointerException: Cannot invoke method getRestriction() on null object at org.codehaus.groovy.runtime.NullObject.invokeMethod(NullObject.java:88) at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:45) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45) at org.codehaus.groovy.runtime.callsite.NullCallSite.call(NullCallSite.java:32) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45) at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:54) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112) at com.onresolve.scriptrunner.canned.jira.utils.WorkflowUtils$_examineConditions_closure2.doCall(WorkflowUtils.groovy:241) <+3> (NativeMethodAccessorImpl.java:62) (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324) at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:278) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1016) at groovy.lang.Closure.call(Closure.java:423) at groovy.lang.Closure.call(Closure.java:439) at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1379) at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1372) at org.codehaus.groovy.runtime.dgm$149.invoke(Unknown Source) at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:271) at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116) at com.onresolve.scriptrunner.canned.jira.utils.WorkflowUtils.examineConditions(WorkflowUtils.groovy:236) at com.onresolve.scriptrunner.canned.jira.utils.WorkflowUtils$examineConditions$1.callStatic(Unknown Source) at com.onresolve.scriptrunner.canned.jira.utils.WorkflowUtils.actionIssueWithFeedBack(WorkflowUtils.groovy:120) <+3> (NativeMethodAccessorImpl.java:62) (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324) at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.invoke(StaticMetaMethodSite.java:43) at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.call(StaticMetaMethodSite.java:88) at com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.FasttrackTransition.doTransition(FasttrackTransition.groovy:147) at com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.FasttrackTransition.this$2$doTransition(FasttrackTransition.groovy) <+3> (NativeMethodAccessorImpl.java:62) (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) Also I found that examineConditions explicitly has: def action = workflowDescriptor.getAction(4) RestrictionDescriptor restriction = action.getRestriction(); and 4 is an ID for the default 'Start Progress' transition, but not of the action configured in the listener itself. Looks like a definite bug. Also, two things missing, which would be very nice to have. First, not always user who generated event has the 'transition issue' permission. Would be nice specify an account for the user performing auto-transition, to override it. The second problem is (not sure how to 'fix' it), that action id configured for the workflow, and workflow may change (copy workflow, update, reapply), and then the listeners have to be udpated. I see that it is a very complex question, how to 'tell' it which transition to perform. but anyway, worth mentionning :) Cheers, Oles

    JIRA | 2 years ago | Oleksii Gnatkevych
    java.lang.NullPointerException: Cannot invoke method getRestriction() on null object
  3. 0

    geb-example-cucumber-jvm on github fails

    Google Groups | 2 years ago | dean.delponte
    java.lang.NullPointerException: Cannot invoke method remove() on null object
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Tape was not loading and returns null in insertTape() method

    GitHub | 3 years ago | JeraldSebastin
    java.lang.NullPointerException: Cannot invoke method size() on null object
  6. 0

    :syncWithRepo FAILED

    GitHub | 2 years ago | xialin
    java.lang.NullPointerException: Cannot invoke method minus() on null object

  1. mortalman7 2 times, last 5 months ago
  2. rlovtangen 1 times, last 6 months ago
22 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.NullPointerException

    Cannot invoke method getRestriction() on null object

    at org.codehaus.groovy.runtime.NullObject.invokeMethod()
  2. Groovy
    AbstractCallSite.call
    1. org.codehaus.groovy.runtime.NullObject.invokeMethod(NullObject.java:88)
    2. org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:45)
    3. org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
    4. org.codehaus.groovy.runtime.callsite.NullCallSite.call(NullCallSite.java:32)
    5. org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
    6. org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:54)
    7. org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
    7 frames
  3. com.onresolve.scriptrunner
    WorkflowUtils$_examineConditions_closure2.doCall
    1. com.onresolve.scriptrunner.canned.jira.utils.WorkflowUtils$_examineConditions_closure2.doCall(WorkflowUtils.groovy:241)
    1 frame
  4. Java RT
    Method.invoke
    1. java.lang.reflect.Method.invoke(Method.java:483)
    1 frame
  5. Groovy
    AbstractCallSite.call
    1. org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
    2. groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324)
    3. org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:278)
    4. groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1016)
    5. groovy.lang.Closure.call(Closure.java:423)
    6. groovy.lang.Closure.call(Closure.java:439)
    7. org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1379)
    8. org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1372)
    9. org.codehaus.groovy.runtime.dgm$149.invoke(Unknown Source)
    10. org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:271)
    11. org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53)
    12. org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
    12 frames
  6. com.onresolve.scriptrunner
    WorkflowUtils.actionIssueWithFeedBack
    1. com.onresolve.scriptrunner.canned.jira.utils.WorkflowUtils.examineConditions(WorkflowUtils.groovy:236)
    2. com.onresolve.scriptrunner.canned.jira.utils.WorkflowUtils$examineConditions$1.callStatic(Unknown Source)
    3. com.onresolve.scriptrunner.canned.jira.utils.WorkflowUtils.actionIssueWithFeedBack(WorkflowUtils.groovy:120)
    3 frames
  7. Java RT
    Method.invoke
    1. java.lang.reflect.Method.invoke(Method.java:483)
    1 frame
  8. Groovy
    StaticMetaMethodSite.call
    1. org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
    2. groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324)
    3. org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.invoke(StaticMetaMethodSite.java:43)
    4. org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.call(StaticMetaMethodSite.java:88)
    4 frames
  9. com.onresolve.scriptrunner
    FasttrackTransition.this$2$doTransition
    1. com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.FasttrackTransition.doTransition(FasttrackTransition.groovy:147)
    2. com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.FasttrackTransition.this$2$doTransition(FasttrackTransition.groovy)
    2 frames
  10. Java RT
    Method.invoke
    1. java.lang.reflect.Method.invoke(Method.java:483)
    1 frame