Received java.lang.NumberFormatException when viewing issue history tab
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Symptoms
The following appears in the atlassian-jira.log
:
1
2
3
4
5
6
7
8
2014-10-22 09:49:51,745 http-bio-xxx-exec-4 ERROR xxx xxxx xxx xxxx /browse/CAPA-106 [com.atlassian.velocity.DefaultVelocityManager] MethodInvocationException occurred getting message body from Velocity: java.lang.NumberFormatException: For input string: "null"
java.lang.NumberFormatException: For input string: "null"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Long.parseLong(Unknown Source)
at java.lang.Long.<init>(Unknown Source)
at com.atlassian.jira.issue.tabpanels.ChangeHistoryAction.getPrettyDuration(ChangeHistoryAction.java:222)
at sun.reflect.GeneratedMethodAccessor7444.invoke(Unknown Source) <+1>
at java.lang.reflect.Method.invoke(Unknown Source)
Diagnose
Search for the Null value in change history table.
1
select * from changeitem where groupid in (select ID from changegroup where issueid in (select ID from jiraissue where project = (select ID from project where pkey = '<PROJECT_KEY>') and issuenum = '<ISSUE_NUMBER>'));
Cause
There are few 'Null' value in change history table.
Workaround
For JIRA 6.x and above
Backup JIRA.
Shutdown JIRA.
Run the SQL command below:
1
update changeitem set newvalue='<ANY_VALUE>' , newstring='<ANY_VALUE>' where groupid in (select ID from changegroup where issueid in (select ID from jiraissue where project = (select ID from project where pkey = '<PROJECT_KEY>') and issuenum = '<ISSUE_NUMBER>')) and newvalue = 'null';
Start JIRA.
Run Integrity Checker to fix any errors returned (if no errors should be fine).
Was this helpful?