Project or XML backup import will lead to NPE
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
Upon performing the project import in JIRA, the following stack-trace will appear on the screen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Cause:
java.util.concurrent.ExecutionException: java.lang.NullPointerException
Stack Trace: [hide]
java.util.concurrent.ExecutionException: java.lang.NullPointerException
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:252)
at java.util.concurrent.FutureTask.get(FutureTask.java:111)
at com.atlassian.jira.task.TaskDescriptorImpl.getResult(TaskDescriptorImpl.java:118)
at com.atlassian.jira.web.bean.TaskDescriptorBean.getResult(TaskDescriptorBean.java:73)
at com.atlassian.jira.web.action.admin.importer.project.ProjectImportBackupOverviewProgress.handleFinishedTask(ProjectImportBackupOverviewProgress.java:36)
at com.atlassian.jira.web.action.admin.importer.project.AbstractProjectImportProgress.doExecute(AbstractProjectImportProgress.java:63)
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)
at webwork.interceptor.NestedInterceptorChain.proceed(NestedInterceptorChain.java:31)
at webwork.interceptor.ChainedInterceptor.intercept(ChainedInterceptor.java:16)
at webwork.interceptor.DefaultInterceptorChain.proceed(DefaultInterceptorChain.java:35)
at webwork.dispatcher.GenericDispatcher.executeAction(GenericDispatcher.java:221)
...
On the logs, the following ERROR will appear:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2013-05-09 17:54:35,524 http-bio-8211-exec-19 ERROR [500ErrorPage.jsp] Exception caught in 500 page java.lang.NullPointerException
java.util.concurrent.ExecutionException: java.lang.NullPointerException
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:252)
at java.util.concurrent.FutureTask.get(FutureTask.java:111)
at com.atlassian.jira.task.TaskDescriptorImpl.getResult(TaskDescriptorImpl.java:118)
at com.atlassian.jira.web.bean.TaskDescriptorBean.getResult(TaskDescriptorBean.java:73)
at com.atlassian.jira.web.action.admin.importer.project.ProjectImportBackupOverviewProgress.handleFinishedTask(ProjectImportBackupOverviewProgress.java:36)
...
Caused by: java.lang.NullPointerException
at java.util.AbstractCollection.addAll(AbstractCollection.java:333)
at com.atlassian.jira.imports.project.util.XMLEscapeUtil.unicodeInPlaceEncode(XMLEscapeUtil.java:201)
at com.atlassian.jira.imports.project.util.XMLEscapeUtil.unicodeInPlaceEncode(XMLEscapeUtil.java:154)
at com.atlassian.jira.util.xml.XMLEscapingReader.read(XMLEscapingReader.java:66)
...
Cause
If a XML backup contains an invalid character(s), such as unicode characters that can not be handled by XML parser, JIRA is unable to perform the upgrade/import correctly. This bug is reported at JRASERVER-33019 - NullPointerException While Restoring JIRA Data If the XML Backup contains the character 𠡬, and has been fixed on JIRA 6.0.1.
Workaround
Download atlassian-xml-cleaner-0.1.jar from this doc (Removing invalid characters from XML backups)
Unzip the XML backup file
In the unzipped folder, find the entities.xml
Open a command prompt and change the directory to where the cleaner was downloaded
Locate the entities.xml file on the command prompt and run the following command:
1
$ java -jar atlassian-xml-cleaner-0.1.jar entities.xml > entities-clean.xml
This will create a new entities-clean.xml
Rename the entities-clean.xml file to entities.xml and compress it to a Zip file with the activeobjects.xml (if any)
Import the newly created Zip file
Resolution
Upgrade to JIRA 6.0.1
Was this helpful?