NullPointerException after importing workflow XML

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

After importing a workflow XML into JIRA, it is associated with a project. However, the workflow is not working and trying to change the workflow scheme will have the following error:

2012-01-13 13:25:08,876 http-8080-1 WARN admin 805x4665x1 1x445vs 10.49.228.67 /plugins/servlet/project-config/CMS/workflows [plugin.web.model.ResourceTemplateWebPanel] Error rendering WebPanel (workflows/workflows.vm): org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getHtml' in  class com.atlassian.jira.web.component.IssueConstantWebComponent threw exception java.lang.NullPointerException at workflows/workflows.vm[line 136, column 65]
com.atlassian.templaterenderer.RenderingException: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getHtml' in  class com.atlassian.jira.web.component.IssueConstantWebComponent threw exception java.lang.NullPointerException at workflows/workflows.vm[line 136, column 65]
	at com.atlassian.templaterenderer.velocity.one.six.internal.VelocityTemplateRendererImpl.render(VelocityTemplateRendererImpl.java:100)
	at com.atlassian.templaterenderer.AbstractVelocityWebPanelRenderer.render(AbstractVelocityWebPanelRenderer.java:33)
	at com.atlassian.plugin.web.model.ResourceTemplateWebPanel.getHtml(ResourceTemplateWebPanel.java:47)
	at com.atlassian.plugin.web.descriptors.DefaultWebPanelModuleDescriptor$ContextAwareWebPanel.getHtml(DefaultWebPanelModuleDescriptor.java:141)
	at com.atlassian.jira.projectconfig.tab.WebPanelTab.getTab(WebPanelTab.java:75)
	at com.atlassian.jira.projectconfig.servlet.PanelServlet.outputTab(PanelServlet.java:163)
	at com.atlassian.jira.projectconfig.servlet.PanelServlet.doGet(PanelServlet.java:136)

...
Caused by: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getHtml' in  class com.atlassian.jira.web.component.IssueConstantWebComponent threw exception java.lang.NullPointerException at workflows/workflows.vm[line 136, column 65]
...
Caused by: java.lang.NullPointerException

Possible Causes

Possibility 1: The workflow XML is not modified to match the Status ID in JIRA. Example line from workflow XML:
      <meta name="jira.status.id">10004</meta>
Possibility 2: An issue status described in the workflow XML does not exist in the issuestatus table in the database. Example lines from workflow XML:
  <step id="3" name="Blocked">
      <meta name="jira.status.id">10004</meta>

Resolution

Possibility 1: The workflow XML is not modified to match the Status ID in JIRA.

Always back up your data before performing any modifications to the database. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.

  1. Shutdown JIRA.
  2. Check the available Status ID in JIRA database:

    SELECT * FROM issuestatus;
  3. Find the affected workflow in JIRA database:

    SELECT * FROM jiraworkflows;

    (info) The imported workflow is stored in the column 'DESCRIPTOR' of the table 'jiraworkflows' in XML format

  4. Search for the problematic Status ID from the table 'jiraworkflows' and modify it to match the result from STEP 3.
  5. Restart JIRA.


Possibility 2: An issue status described in the workflow XML does not exist in the issuestatus table in the database.

Always back up your data before performing any modifications to the database. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.

  1. Shutdown JIRA.
  2. Check all available issuestatuses in JIRA database:

    SELECT * FROM issuestatus;
  3. Insert the needed issue status:

    INSERT INTO issuestatus (ID, SEQUENCE, pname, DESCRIPTION, ICONURL) VALUES("1004", "<check available sequences in issuestatus table and add 1>", "Blocked", "This issue is blocked by a blocking issue", "/images/icons/status_closed.gif");
  4. Restart JIRA.



Last modified on Mar 11, 2019

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.