- edited description
NullPointerException occurred while trying to build a timesheet report
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)
-
reporter -
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.
-
- changed status to duplicate
Duplicate of
#437. -
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?
-
reporter - changed status to open
-
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.
-
reporter Ok, we will restart JIRA and I'll inform you how it goes. Thank you.
-
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.
-
Michael, could you please confirm you see version 2.6.2, build
#477in the bottom of the report page (footer), or in Administration - Add-Ons - Manage Add-Ons?Regarding the slow loading, did you use patched plugin for the problem described here: https://bitbucket.org/azhdanov/jiratimesheet/wiki/JRA-32510%20Timesheet%20report%20time-out%20workaround ? If so, you might better rollback to 2.6, and wait till patched 2.6.2 is available.
Thank you.
-
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?
-
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.
-
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?
-
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.
-
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
-
Ok, it make sense now, thank you for trying this again! Could you please clarify your JIRA version?
Thank you.
-
reporter I made these tests in JIRA 5.2.5
-
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.
-
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.
-
Thanks, reproduced, should fix soon.
-
reporter Thank you for the quick responses, we appreciate your help!
-
- changed status to resolved
resolve issue
#438: fix NPE rendering some custom fields - check if FieldLayoutItem is available for the field→ <<cset c73405d6581e>>
-
Hi Michael,
Version 2.6.3 with the fix, is available on Atlassian Marketplace. However, in your case, please see patched version: jira-timesheet-plugin-2.6.3-JRA-32510.jar
Thank you for your patience and help with resolving the problem.
-
reporter Hi Andriy, Thank you for the assistance!
- Log in to comment