NullPointerException occurred while trying to build a timesheet report

Issue #438 resolved
Michael I. created an issue

Could you please explain, what was causing this error and how can it be fixed? Here is the significant part of the stack trace:

java.lang.NullPointerException at com.atlassian.jira.issue.managers.DefaultRendererManager.getRenderedContent(DefaultRendererManager.java:127) at com.atlassian.jira.issue.fields.CustomFieldImpl.getRendererCustomFieldValue(CustomFieldImpl.java:911) at com.atlassian.jira.issue.fields.CustomFieldImpl.getViewHtml(CustomFieldImpl.java:1108) at com.atlassian.jira.issue.fields.CustomFieldImpl.getViewHtml(CustomFieldImpl.java:1103) at com.fdu.jira.util.TextUtil.getFieldValue(TextUtil.java:301) at com.fdu.jira.util.TextUtil.getFieldValue(TextUtil.java:266) at jira.plugin.report.timesheet.TimesheetService.calculateTimesForProjectGroupedByField(TimesheetService.java:401) at jira.plugin.report.timesheet.TimesheetService.processSingle(TimesheetService.java:202) at jira.plugin.report.timesheet.TimesheetService.processSingle(TimesheetService.java:48) at jira.plugin.report.timesheet.TimeBaseService.getTimeSpents(TimeBaseService.java:302) at com.fdu.jira.plugin.report.timesheet.TimeSheet.generateReport(TimeSheet.java:88) at com.fdu.jira.plugin.report.AbstractTimebaseReport.generateReportHtml(AbstractTimebaseReport.java:56) at com.atlassian.jira.web.action.browser.ConfigureReport.doExecute(ConfigureReport.java:156) at webwork.action.ActionSupport.execute(ActionSupport.java:165) at com.atlassian.jira.action.JiraActionSupport.execute(JiraActionSupport.java:82) at webwork.interceptor.DefaultInterceptorChain.proceed(DefaultInterceptorChain.java:39)

UPDATE: This error is reproduced when I select a field with type "Text Field (< 255 characters)" at the "Group by Field" select list.

Comments (23)

  1. Andriy Zhdanov

    Hi Michael,

    Could you please try version 2.6.2, it should be fixed now. It is a regression caused by rendering Additional Fields differently then before, for isuue #432.

    Thank you.

  2. Michael I. reporter

    Andriy, I updated the plugin to version 2.6.2, but the problem still persists. Should I restart JIRA or do something else to apply changes?

  3. Andriy Zhdanov

    Well, I did not think restart is needed, but looks like it's not updated in your case, please try restarting and make sure version is updated to 2.6.2, you should see it in the bottom of Time Sheet Report screen or in Administration - Add-Ons.

    Thank you.

  4. Michael I. reporter

    Andriy, after the restart the problem did not solved...

    Also, I see that the "Configure Report" screen now loads REALLY slowly. I understand that it is another issue, so I just mention it here.

  5. Michael I. reporter

    Yes, I see those version and build at the Add-ons screen.

    If it is not possible to fix this issue quickly, can you please provide us an older but guaranteed stable version?

  6. Andriy Zhdanov

    Ok, thank you for clarifying.

    As I've said, please try installing 2.6. But it looks like there is something wrong with reinstalling the plugin in your case. May be you should check there is no 2.6.1 left out on filesystem. E.g. find jira-home -name jira-timesheet-plugin*.jar

    Thank you.

    Thank you.

  7. Michael I. reporter

    Hi again, Andriy. Thank you for the assistance, it looks like the patched version 2.6 works properly.

    But after the testing I have to say, that this issue is still reproducing with version 2.6.2. Neither re-installing nor JIRA restart not affect - the report bulider throws NPE the same as at 2.6.1, so I don't think that there was some installing issue.

    Also, the workaround that you mentioned before enables to avoid the very slow loading, but select lists are more user-friendly than the text fields. Do you plan a general fix?

  8. Andriy Zhdanov

    Hi Michael,

    1) Regarding NPE, this is really strange that it happens with 2.6.2 if it is properly installed. Let me try to explain. The stack trace in the description shows this:

    com.atlassian.jira.issue.fields.CustomFieldImpl.getViewHtml(CustomFieldImpl.java:1103)
    at com.fdu.jira.util.TextUtil.getFieldValue(TextUtil.java:301) at
    

    But in version 2.6.2 there is no call to getViewHtml(): https://bitbucket.org/azhdanov/jiratimesheet/src/299f778314c847eb5d3fa6751277807a8814c273/src/main/java/com/fdu/jira/util/TextUtil.java?at=default#cl-301

    So may be it just looks the same, but error or just stack trace is different with 2.6.2?

    2) It's JIRA problem, as described on the wiki page I've sent above, and it is fixed in 6.1

    Thank you.

  9. Michael I. reporter

    1) Here is the new stack-trace:

    java.lang.NullPointerException
        at com.atlassian.jira.issue.managers.DefaultRendererManager.getRenderedContent(DefaultRendererManager.java:127)
        at com.atlassian.jira.issue.fields.CustomFieldImpl.getRendererCustomFieldValue(CustomFieldImpl.java:911)
        at com.atlassian.jira.issue.fields.CustomFieldImpl.getViewHtml(CustomFieldImpl.java:1108)
        at com.atlassian.jira.issue.fields.CustomFieldImpl.getViewHtml(CustomFieldImpl.java:1103)
        at com.fdu.jira.util.TextUtil.getFieldValue(TextUtil.java:303)
        at com.fdu.jira.util.TextUtil.getFieldValue(TextUtil.java:266)
        at jira.plugin.report.timesheet.TimesheetService.calculateTimesForProjectGroupedByField(TimesheetService.java:401)
        at jira.plugin.report.timesheet.TimesheetService.processSingle(TimesheetService.java:202)
        at jira.plugin.report.timesheet.TimesheetService.processSingle(TimesheetService.java:48)
        at jira.plugin.report.timesheet.TimeBaseService.getTimeSpents(TimeBaseService.java:302)
        at com.fdu.jira.plugin.report.timesheet.TimeSheet.generateReport(TimeSheet.java:88)
        at com.fdu.jira.plugin.report.AbstractTimebaseReport.generateReportHtml(AbstractTimebaseReport.java:56)
        at com.atlassian.jira.web.action.browser.ConfigureReport.doExecute(ConfigureReport.java:156)
        at webwork.action.ActionSupport.execute(ActionSupport.java:165)
        at com.atlassian.jira.action.JiraActionSupport.execute(JiraActionSupport.java:82)
    

    Comparing it with the first one, I can see that they are almost identical, the only difference is at this row: * "at com.fdu.jira.util.TextUtil.getFieldValue(TextUtil.java:301)" - before; * "at com.fdu.jira.util.TextUtil.getFieldValue(TextUtil.java:303)" - now

  10. Andriy Zhdanov

    Ok, it make sense now, thank you for trying this again! Could you please clarify your JIRA version?

    Thank you.

  11. Andriy Zhdanov

    Sorry, one more question, do you know what field is causing this? It must be Custom Field that has no value for an issue. In other words, NPE should happen for some certain Additional Field or Group By Field option of the Time Sheet Report configuration.

    Thank you.

  12. Michael I. reporter

    Of course, I found out that this NPE occurs if a certain custom field (type - Text field, 255 chars) is selected in "Group By Field" dropdown list.

    This is our case, but maybe there are a number of another ones.

  13. Log in to comment