java.lang.NullPointerException

Atlassian JIRA | Matheus Fernandes | 2 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    h3. Summary JIRA Software allows the *Epic Status* field to be edited, which causes a *NullPointerException* when running calling: * {code:none}GET /rest/agile/1.0/board/{boardId}/epic/{epicId}/issue{code} * {code:none}GET /rest/agile/1.0/board/{boardId}/sprint/{sprintId}/issue{code} as {{EpicServiceImpl.getEpicStatusValue(issue)}} expects an *Epic Status* to exist. h3. Steps to Reproduce # Create an Epic and browse to it. # Select 'Edit'; _alternatively, Select 'Admin > Add Field'_ # Edit the *Epic Status* to none h3. Expected Results * It would not be possible to change the *Epic Status* to {{none}}; * Or the endpoints wouldn't return a 500 error when parsing Epics with no statuses. h3. Actual Results The below exception is thrown in the {{atlassian-jira.log}} file or as a response on the API call: {noformat} 2015-10-12 17:32:04,109 ajp-nio-8077-exec-2 ERROR matheus 1052x9377x1 13woces 192.168.10.96 /rest/agile/1.0/board/1/epic/10107/issue [c.a.p.r.c.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service: null java.lang.NullPointerException at com.atlassian.greenhopper.service.issuelink.EpicServiceImpl.getEpicStatusValue(EpicServiceImpl.java:221) at com.atlassian.greenhopper.service.issuelink.EpicServiceImpl.getEpic(EpicServiceImpl.java:171) at com.atlassian.greenhopper.api.rest.BoardEpicResource$2.apply(BoardEpicResource.java:205) at com.atlassian.greenhopper.api.rest.util.IssueResourceHelper$1.apply(IssueResourceHelper.java:125) at com.atlassian.greenhopper.api.rest.util.BoardResourceHelper.executeWithBoard(BoardResourceHelper.java:54) at com.atlassian.greenhopper.api.rest.util.IssueResourceHelper.searchIssueByQueryParamsForBoard(IssueResourceHelper.java:112) at com.atlassian.greenhopper.api.rest.BoardEpicResource.getIssuesForEpic(BoardEpicResource.java:200) ... 3 filtered at java.lang.reflect.Method.invoke(Method.java:483) ... 19 filtered at com.atlassian.plugins.rest.module.RestDelegatingServletFilter$JerseyOsgiServletContainer.doFilter(RestDelegatingServletFilter.java:178) ... 1 filtered at com.atlassian.plugins.rest.module.RestDelegatingServletFilter.doFilter(RestDelegatingServletFilter.java:73) ... 41 filtered at com.atlassian.plugins.cors.CorsFilter.doFilter(CorsFilter.java:65) ... 64 filtered at com.atlassian.plugins.rest.module.servlet.RestSeraphFilter.doFilter(RestSeraphFilter.java:40) ... 72 filtered at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) {noformat} h3.Workaround # Search for all Epics with no status: {code:SQL} type = 'Epic' and "Epic Status" is EMPTY {code} # Manually (or bulk) edit those and add a value for the *Epic Status* field.

    Atlassian JIRA | 2 years ago | Matheus Fernandes
    java.lang.NullPointerException

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at com.atlassian.greenhopper.service.issuelink.EpicServiceImpl.getEpicStatusValue()
    2. com.atlassian.greenhopper
      BoardEpicResource.getIssuesForEpic
      1. com.atlassian.greenhopper.service.issuelink.EpicServiceImpl.getEpicStatusValue(EpicServiceImpl.java:221)
      2. com.atlassian.greenhopper.service.issuelink.EpicServiceImpl.getEpic(EpicServiceImpl.java:171)
      3. com.atlassian.greenhopper.api.rest.BoardEpicResource$2.apply(BoardEpicResource.java:205)
      4. com.atlassian.greenhopper.api.rest.util.IssueResourceHelper$1.apply(IssueResourceHelper.java:125)
      5. com.atlassian.greenhopper.api.rest.util.BoardResourceHelper.executeWithBoard(BoardResourceHelper.java:54)
      6. com.atlassian.greenhopper.api.rest.util.IssueResourceHelper.searchIssueByQueryParamsForBoard(IssueResourceHelper.java:112)
      7. com.atlassian.greenhopper.api.rest.BoardEpicResource.getIssuesForEpic(BoardEpicResource.java:200)
      7 frames