Uploaded image for project: 'Jira Server and Data Center'
  1. Jira Server and Data Center
  2. JRASERVER-19556

The 'SimpleWorkflowManager.isEditable' method can throw a NPE when called with an issue without a status.

    XMLWordPrintable

Details

    Description

      Symptom

      When creating a JIRA issue, a NullPointException is generated.

      The following appears within atlassian-jira.log:

      java.lang.NullPointerException
      	at com.atlassian.jira.workflow.SimpleWorkflowManager.isEditable(SimpleWorkflowManager.java:520)
      	at com.atlassian.jira.issue.managers.DefaultIssueManager.isEditable(DefaultIssueManager.java:379)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at com.atlassian.util.profiling.object.ObjectProfiler.profiledInvoke(ObjectProfiler.java:70)
      	at com.atlassian.jira.config.component.SwitchingInvocationHandler.invoke(SwitchingInvocationHandler.java:28)
      	at $Proxy38.isEditable(Unknown Source)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at com.atlassian.plugin.osgi.hostcomponents.impl.DefaultComponentRegistrar$ContextClassLoaderSettingInvocationHandler.invoke(DefaultComponentRegistrar.java:129)
      	at $Proxy38.isEditable(Unknown Source)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at com.atlassian.plugin.osgi.bridge.external.HostComponentFactoryBean$DynamicServiceInvocationHandler.invoke(HostComponentFactoryBean.java:150)
      	at $Proxy38.isEditable(Unknown Source)
      	at com.atlassian.jira.toolkit.customfield.NullCFType.getVelocityParameters(NullCFType.java:51)
      	at com.atlassian.jira.issue.customfields.CustomFieldUtils.buildParams(CustomFieldUtils.java:408)
      	at com.atlassian.jira.plugin.customfield.CustomFieldTypeModuleDescriptor.getEditHtml(CustomFieldTypeModuleDescriptor.java:86)
      	at com.atlassian.jira.issue.fields.CustomFieldImpl.getEditHtml(CustomFieldImpl.java:897)
      	at com.atlassian.jira.issue.fields.CustomFieldImpl.getCreateHtml(CustomFieldImpl.java:883)
      	at com.atlassian.jira.issue.fields.CustomFieldImpl.getCreateHtml(CustomFieldImpl.java:878)
      

      And the below may also be present:

      2012-08-18 15:49:27,711 http-8080-9 ERROR      [500ErrorPage.jsp] Exception caught in 500 page null
      java.lang.NullPointerException
      	at com.atlassian.jira.workflow.OSWorkflowManager.isEditable(OSWorkflowManager.java:1077)
      	at com.atlassian.jira.issue.managers.DefaultIssueManager.isEditable(DefaultIssueManager.java:464)
      	at sun.reflect.GeneratedMethodAccessor563.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      	at java.lang.reflect.Method.invoke(Unknown Source)
      

      Cause

      The SimpleWorkflowManager.isEditable or OSWorkflowManager.isEditable methods can throw a NPE when called with an issue without a status. The most common way for this to occur is for a custom field to call this method on the 'Create Issue' screen (i.e. before the issue is associated with a workflow).

      For example, the supporttools (i.e. NullCFType) field from the JIRA Toolkit plugin does this.

      Workaround

      1. Delete the Support Tools Bar custom field under Administration > Custom Fields.
      2. Disable the Support Tool Bar (supporttools) module under Administration > Plugins > JIRA Toolkit Plugin > expand the modules enabled section.

      Attachments

        Issue Links

          Activity

            People

              lwlodarczyk Lukasz Wlodarczyk
              bbain bain
              Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: