java.lang.NullPointerException

Atlassian JIRA | Tim Pettersen | 6 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

    The list of JIRA projects in a linked JIRA instance is loaded once and cached permanently: {code} private Map<String, Long> getProjects() throws IOException, RemoteJiraException, CredentialsRequiredException, NotPermittedException { if (projectIds == null) { final ImmutableMap.Builder<String, Long> builder = ImmutableMap.builder(); for (RemoteProject project : invoke(new JiraSoapOperation<RemoteProject[]>() { public RemoteProject[] run(JiraSoapService jiraSoapService, String authToken) throws RemoteException { return jiraSoapService.getProjectsNoSchemes(authToken); } })) { builder.put(project.getKey(), Long.parseLong(project.getId())); } projectIds = builder.build(); } return projectIds; } {code} This should be time expired, or we should provide some flushing mechanism. This causes NPEs (due to autounboxing a null Long value) when attempting to retrieve JIRA issues from a project that was created in JIRA _after_ your Application Link was created but _before_ the next FishEye server restart. {code} java.lang.NullPointerException at com.atlassian.fisheye.jira.JiraIssueImpl.copyFieldsFrom(JiraIssueImpl.java:92) at com.atlassian.fisheye.jira.JiraIssueImpl.<init>(JiraIssueImpl.java:75) at com.atlassian.fisheye.jira.JiraServerImpl.getIssue(JiraServerImpl.java:249) at com.atlassian.fisheye.jira.issue.JiraIssueServiceImpl.retrieveJiraIssue(JiraIssueServiceImpl.java:277) at com.atlassian.fisheye.jira.issue.JiraIssueServiceImpl.getJiraIssue(JiraIssueServiceImpl.java:183) at com.atlassian.fisheye.jira.issue.JiraIssueServiceImpl.getJiraIssue(JiraIssueServiceImpl.java:126) at com.atlassian.fisheye.jira.action.JiraIssueAjaxAction.execute(JiraIssueAjaxAction.java:34) at sun.reflect.GeneratedMethodAccessor4452.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.opensymphony.xwork.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:358) ........snip........ {code}

    Atlassian JIRA | 6 years ago | Tim Pettersen
    java.lang.NullPointerException
  2. 0

    The list of JIRA projects in a linked JIRA instance is loaded once and cached permanently: {code} private Map<String, Long> getProjects() throws IOException, RemoteJiraException, CredentialsRequiredException, NotPermittedException { if (projectIds == null) { final ImmutableMap.Builder<String, Long> builder = ImmutableMap.builder(); for (RemoteProject project : invoke(new JiraSoapOperation<RemoteProject[]>() { public RemoteProject[] run(JiraSoapService jiraSoapService, String authToken) throws RemoteException { return jiraSoapService.getProjectsNoSchemes(authToken); } })) { builder.put(project.getKey(), Long.parseLong(project.getId())); } projectIds = builder.build(); } return projectIds; } {code} This should be time expired, or we should provide some flushing mechanism. This causes NPEs (due to autounboxing a null Long value) when attempting to retrieve JIRA issues from a project that was created in JIRA _after_ your Application Link was created but _before_ the next FishEye server restart. {code} java.lang.NullPointerException at com.atlassian.fisheye.jira.JiraIssueImpl.copyFieldsFrom(JiraIssueImpl.java:92) at com.atlassian.fisheye.jira.JiraIssueImpl.<init>(JiraIssueImpl.java:75) at com.atlassian.fisheye.jira.JiraServerImpl.getIssue(JiraServerImpl.java:249) at com.atlassian.fisheye.jira.issue.JiraIssueServiceImpl.retrieveJiraIssue(JiraIssueServiceImpl.java:277) at com.atlassian.fisheye.jira.issue.JiraIssueServiceImpl.getJiraIssue(JiraIssueServiceImpl.java:183) at com.atlassian.fisheye.jira.issue.JiraIssueServiceImpl.getJiraIssue(JiraIssueServiceImpl.java:126) at com.atlassian.fisheye.jira.action.JiraIssueAjaxAction.execute(JiraIssueAjaxAction.java:34) at sun.reflect.GeneratedMethodAccessor4452.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.opensymphony.xwork.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:358) ........snip........ {code}

    Atlassian JIRA | 6 years ago | Tim Pettersen
    java.lang.NullPointerException

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at com.atlassian.fisheye.jira.JiraIssueImpl.copyFieldsFrom()
    2. com.atlassian.fisheye
      JiraIssueAjaxAction.execute
      1. com.atlassian.fisheye.jira.JiraIssueImpl.copyFieldsFrom(JiraIssueImpl.java:92)
      2. com.atlassian.fisheye.jira.JiraIssueImpl.<init>(JiraIssueImpl.java:75)
      3. com.atlassian.fisheye.jira.JiraServerImpl.getIssue(JiraServerImpl.java:249)
      4. com.atlassian.fisheye.jira.issue.JiraIssueServiceImpl.retrieveJiraIssue(JiraIssueServiceImpl.java:277)
      5. com.atlassian.fisheye.jira.issue.JiraIssueServiceImpl.getJiraIssue(JiraIssueServiceImpl.java:183)
      6. com.atlassian.fisheye.jira.issue.JiraIssueServiceImpl.getJiraIssue(JiraIssueServiceImpl.java:126)
      7. com.atlassian.fisheye.jira.action.JiraIssueAjaxAction.execute(JiraIssueAjaxAction.java:34)
      7 frames
    3. Java RT
      Method.invoke
      1. sun.reflect.GeneratedMethodAccessor4452.invoke(Unknown Source)
      2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      3. java.lang.reflect.Method.invoke(Method.java:597)
      3 frames
    4. XWork Tiger Extensions
      DefaultActionInvocation.invokeAction
      1. com.opensymphony.xwork.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:358)
      1 frame