Troubleshooting error due to an event with a null template when exporting a project using Project Configurator for Jira
Problem Statement
When exporting a project, the process fails with an error shown below related to an event with a null template.
Error Message
javax.xml.bind.MarshalException
with linked exception:
[org.xml.sax.SAXParseException; lineNumber: 0; columnNumber: 0; cvc-complex-type.2.4.b: The content of element 'eventType' is not complete. One of '{template}' is expected.]
Location:
GlobalObjectsTableType.EventTypes[eventTypes=[EventType[name=Changes Required,description=This is the 'issue changes required' event,template=<null>,entityName=<null>], EventType[name=Committed,description=This is the 'issue committed' event,template=Issue Commented,entityName=<null>], EventType[name=In Progress,description=This is the 'issue in progress' event,template=Work Started,entityName=<null>], EventType[name=Level 1,description=This is the 'level 1' event,template=<null>,entityName=<null>], EventType[name=Level 2,description=This is the 'level 2 event,template=<null>,entityName=<null>], EventType[name=Project Closed,description=This is the "issue closed" event,template=Issue Closed,entityName=<null>], EventType[name=Ready For Production,description=This is the 'ready for production' event,template=<null>,entityName=<null>], EventType[name=Ready To Publish,description=This is the 'Ready To Publish' event,template=<null>,entityName=<null>], EventType[name=Rolled Out,description=This is the 'rolled out' event,template=<null>,entityName=<null>], EventType[name=Testing,description=This is the 'issue testing' event,template=Issue Comment Deleted,entityName=<null>], EventType[name=Video Edited,description=This is the 'issue edited' event,template=<null>,entityName=<null>], EventType[name=Video Planned,description=This is the 'issue planned' event,template=Issue Restored,entityName=<null>], EventType[name=Video Published,description=This is the 'issue published' event,template=<null>,entityName=<null>], EventType[name=Video Shot,description=This is the 'issue shot' event,template=<null>,entityName=<null>]],orderBy=<null>]
Log Entries
ERROR dmart 984x2005x1 1jfkjj3 75.183.144.83,10.242.92.252 /secure/project-export!export.jspa [c.a.projectconfigurator.projectconfigserialize.ProjectConfigSerializingContext] GlobalObjectsTableType.EventTypes[eventTypes=[EventType[name=Changes Required,description=This is the 'issue changes required' event,template=<null>,entityName=<null>], EventType[name=Committed,description=This is the 'issue committed' event,template=Issue Commented,entityName=<null>], EventType[name=In Progress,description=This is the 'issue in progress' event,template=Work Started,entityName=<null>], EventType[name=Level 1,description=This is the 'level 1' event,template=<null>,entityName=<null>], EventType[name=Level 2,description=This is the 'level 2 event,template=<null>,entityName=<null>], EventType[name=Project Closed,description=This is the "issue closed" event,template=Issue Closed,entityName=<null>], EventType[name=Ready For Production,description=This is the 'ready for production' event,template=<null>,entityName=<null>], EventType[name=Ready To Publish,description=This is the 'Ready To Publish' event,template=<null>,entityName=<null>], EventType[name=Rolled Out,description=This is the 'rolled out' event,template=<null>,entityName=<null>], EventType[name=Testing,description=This is the 'issue testing' event,template=Issue Comment Deleted,entityName=<null>], EventType[name=Video Edited,description=This is the 'issue edited' event,template=<null>,entityName=<null>], EventType[name=Video Planned,description=This is the 'issue planned' event,template=Issue Restored,entityName=<null>], EventType[name=Video Published,description=This is the 'issue published' event,template=<null>,entityName=<null>], EventType[name=Video Shot,description=This is the 'issue shot' event,template=<null>,entityName=<null>]],orderBy=<null>] javax.xml.bind.MarshalException
- with linked exception:
[org.xml.sax.SAXParseException; lineNumber: 0; columnNumber: 0; cvc-complex-type.2.4.b: The content of element 'eventType' is not complete. One of '{template}' is expected.]
com.awnaba.projectconfigurator.utils.errorhandling.XMLDumpValidationException: javax.xml.bind.MarshalException
- with linked exception:
[org.xml.sax.SAXParseException; lineNumber: 0; columnNumber: 0; cvc-complex-type.2.4.b: The content of element 'eventType' is not complete. One of '{template}' is expected.]
at com.awnaba.projectconfigurator.utils.XMLUtils.dumpXML(XMLUtils.java:98)
at com.awnaba.projectconfigurator.projectconfigserialize.ExportManager.dumpConfigurations(ExportManager.java:97)
at com.awnaba.projectconfigurator.operationsapi.impl.ConfigExporterTask.call(ConfigExporterTask.java:40)
at com.awnaba.projectconfigurator.operationsapi.impl.ConfigExporterTask.call(ConfigExporterTask.java:1)
at com.awnaba.projectconfigurator.longrunningtasks.TaskHelperImpl$WrappingTask.safeCall(TaskHelperImpl.java:206)
at com.awnaba.projectconfigurator.longrunningtasks.TaskHelperImpl$WrappingTask.call(TaskHelperImpl.java:152)
at com.awnaba.projectconfigurator.longrunningtasks.TaskHelperImpl$WrappingTask.call(TaskHelperImpl.java:1)
at com.atlassian.jira.task.TaskManagerImpl$TaskCallableDecorator.call(TaskManagerImpl.java:533)
at com.atlassian.jira.task.TaskManagerImpl$TaskCallableDecorator.call(TaskManagerImpl.java:491)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at com.atlassian.jira.task.ForkedThreadExecutor$ForkedRunnableDecorator.run(ForkedThreadExecutor.java:216)
at java.lang.Thread.run(Thread.java:745)
Caused by: javax.xml.bind.MarshalException
- with linked exception:
[org.xml.sax.SAXParseException; lineNumber: 0; columnNumber: 0; cvc-complex-type.2.4.b: The content of element 'eventType' is not complete. One of '{template}' is expected.]
at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:331)
at com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:256)
at javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshallerImpl.java:116)
... 13 more
Caused by: org.xml.sax.SAXParseException; lineNumber: 0; columnNumber: 0; cvc-complex-type.2.4.b: The content of element 'eventType' is not complete. One of '{template}' is expected.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
Cause
If an event is required in Jira and the Project Configurator also requires it for its export process, and if the event content is incomplete i.e., having a null template selected, then Project Configurator throws the exception“The content of element 'eventType' is not complete. One of '{template}' is expected.
“ during the export.
Solution
Navigate to Administration > System. Select Advanced > Events
From the exception, identify the event with the null template. For example, from the below error, the event “Changes Required” template is null.
[EventType[name=Changes Required,description=This is the 'issue changes required' event,template=<null>,entityName=<null>]
Now edit that event, select a template for it, and ensure all the events have a default template.
Perform a fresh export.