JIRA Crashes while Creating an Issue
症状
The following error appeared while creating a JIRA issue:
...
Cause:
com.thoughtworks.xstream.mapper.CannotResolveClassException: java.util.Collections-UnmodifiableList : java.util.Collections-UnmodifiableList
Stack Trace: [hide]
com.thoughtworks.xstream.mapper.CannotResolveClassException: java.util.Collections-UnmodifiableList : java.util.Collections-UnmodifiableList
at com.thoughtworks.xstream.mapper.DefaultMapper.realClass(DefaultMapper.java:68)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38)
at com.thoughtworks.xstream.mapper.DynamicProxyMapper.realClass(DynamicProxyMapper.java:71)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38)
at com.thoughtworks.xstream.mapper.PackageAliasingMapper.realClass(PackageAliasingMapper.java:88)
...
at com.atlassian.jira.issue.customfields.manager.DefaultGenericConfigManager.fromXml(DefaultGenericConfigManager.java:139)
at com.atlassian.jira.issue.customfields.manager.DefaultGenericConfigManager.retrieve(DefaultGenericConfigManager.java:94)
at com.atlassian.jira.issue.customfields.manager.CachedGenericConfigManager.retrieve(CachedGenericConfigManager.java:72)
at com.atlassian.jira.issue.customfields.impl.AbstractMultiCFType.getDefaultValue(AbstractMultiCFType.java:77)
at com.atlassian.jira.issue.fields.CustomFieldImpl.populateDefaults(CustomFieldImpl.java:542)
at com.atlassian.jira.issue.fields.screen.FieldScreenRenderLayoutItemImpl.populateDefaults(FieldScreenRenderLayoutItemImpl.java:92)
at com.atlassian.jira.web.action.issue.CreateIssue.populateFieldHolderWithDefaults(CreateIssue.java:286)
at com.atlassian.jira.web.action.issue.CreateIssue.doExecute(CreateIssue.java:169)
...
atlassian-jira.log
に次のエラーが返される。
...
com.thoughtworks.xstream.mapper.CannotResolveClassException: java.util.Collections-UnmodifiableList : java.util.Collections-UnmodifiableList
at com.thoughtworks.xstream.mapper.DefaultMapper.realClass(DefaultMapper.java:68)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38)
at com.thoughtworks.xstream.mapper.DynamicProxyMapper.realClass(DynamicProxyMapper.java:71)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38)
at com.thoughtworks.xstream.mapper.PackageAliasingMapper.realClass(PackageAliasingMapper.java:88)
...
at com.atlassian.jira.issue.customfields.manager.DefaultGenericConfigManager.fromXml(DefaultGenericConfigManager.java:139)
at com.atlassian.jira.issue.customfields.manager.DefaultGenericConfigManager.retrieve(DefaultGenericConfigManager.java:94)
at com.atlassian.jira.issue.customfields.manager.CachedGenericConfigManager.retrieve(CachedGenericConfigManager.java:72)
at com.atlassian.jira.issue.customfields.impl.AbstractMultiCFType.getDefaultValue(AbstractMultiCFType.java:77)
at com.atlassian.jira.issue.fields.CustomFieldImpl.populateDefaults(CustomFieldImpl.java:542)
at com.atlassian.jira.issue.fields.screen.FieldScreenRenderLayoutItemImpl.populateDefaults(FieldScreenRenderLayoutItemImpl.java:92)
at com.atlassian.jira.web.action.issue.CreateIssue.populateFieldHolderWithDefaults(CreateIssue.java:286)
at com.atlassian.jira.web.action.issue.CreateIssue.doExecute(CreateIssue.java:169)
...
原因
The root cause is still unknown. Past cases indicates that this problem happens only after upgrading to JIRA 4.2.x with the previous JIRA versions having a Multi User Picker custom field with an invalid default value of the custom field.
ソリューション
Here are the following steps on how to fix this problem:
Run the following SQL queries to find out the problematic custom field:
select * from genericconfiguration where XMLVALUE like '%UnmodifiableRandomAccessList%';
Which should return results like the following:
| ID | DATATYPE | DATAKEY | XMLVALUE +-------+--------------+----------------+---------------------------------------------------------------------------------------------------------------- | 10335 | DefaultValue | 10508 | <java.util.Collections-UnmodifiableRandomAccessList resolves-to="java.util.Collections-$UnmodifiableList"> <list> <string>joachim.ooi</string> <string>justin.alex</string> <string>janet.albion</string> <string>chaiying.chan</string> <string>kahloun.foong</string> <string>voonkiat.gan</string> <string>ahmad.faisal</string> <string>ali.jawad</string> <string>muhammad.fahd</string> <string>sultan.maiyaki</string> </list> <c class="list" reference="../list"/> </java.util.Collections-UnmodifiableRandomAccessList>
GENERICCONFIGURATION.datakey = FIELDCONFIGSCHEME.id
With this information above, run the next SQL query below:
select * from fieldconfigscheme where id = 10508;
| ID | configname | DESCRIPTION | FIELDID | CUSTOMFIELD | +-------+---------------------------+----------------------------+-------------------+-------------+ | 10508 | Staff Training & Education| Staff Training & Education | customfield_10070 | NULL |
Run the next SQL statement:
select * from customfield where ID=10070;
+-------+-------------------------------------------------------------------+---------------------------------------------------------------------------+-----------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------+-----------+---------+-----------+ | ID | CUSTOMFIELDTYPEKEY | CUSTOMFIELDSEARCHERKEY | cfname | DESCRIPTION | defaultvalue | FIELDTYPE | PROJECT | ISSUETYPE | +-------+-------------------------------------------------------------------+---------------------------------------------------------------------------+-----------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------+-----------+---------+-----------+ | 10070 | com.atlassian.jira.plugin.system.customfieldtypes:multiuserpicker | com.atlassian.jira.plugin.system.customfieldtypes:userpickergroupsearcher | Notify Issue to | At Issue Creation, "Reporter" can force a number of "Users" to be advised (via email) of the issue creation. N.B. This does not imply they'll become automatically "watchers" of the issue. If they want to become "watchers" they'll have to subscribe after they'll receive the email on issue creation, by loggin in on JIRA. | NULL | NULL | NULL | NULL | +-------+-------------------------------------------------------------------+---------------------------------------------------------------------------+-----------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------+-----------+---------+-----------+ ...
FIELDCONFIGSCHEME.fieldid = CUSTOMFIELD.id
- This means that even without creating issue to replicate this problem, this problem can be seen by just going to Notify Issue to custom field (
cfname
) which is a Multi User Picker custom field type and clicking on 'Edit Default Value' will throws the same error as well. - Try creating a similar custom field of 'Multi User Picker' and set the default value by putting in all the list of users shown above from the SQL query result to compare the default XML value of the problematic and non-problematic custom field.
Execute the same SQL query as in Step 1 (select * from genericconfiguration where XMLVALUE like '%UnmodifiableRandomAccessList%';) - spot the difference below:
Problematic:
<list> <string>joachim.ooi</string> <string>justin.alex</string> <string>janet.albion</string> <string>chaiying.chan</string> <string>kahloun.foong</string> <string>voonkiat.gan</string> <string>ahmad.faisal</string> <string>ali.jawad</string> <string>muhammad.fahd</string> <string>sultan.maiyaki</string> </list> <c class="list" reference="../list"/>
Compared with the non-problematic:
<c class="list"> <string>joachim.ooi</string> <string>justin.alex</string> <string>janet.albion</string> <string>chaiying.chan</string> <string>kahloun.foong</string> <string>voonkiat.gan</string> <string>ahmad.faisal</string> <string>ali.jawad</string> <string>muhammad.fahd</string> <string>sultan.maiyaki</string> </c> <list reference="../c"/>
Fix this problem by updating the default content of the custom field:
update genericconfiguration set XMLVALUE = '<java.util.Collections_-UnmodifiableRandomAccessList resolves-to="java.util.Collections$UnmodifiableList"> <c class="list"> <string>joachim.ooi</string> <string>justin.alex</string> <string>janet.albion</string> <string>chaiying.chan</string> <string>kahloun.foong</string> <string>voonkiat.gan</string> <string>ahmad.faisal</string> <string>ali.jawad</string> <string>muhammad.fahd</string> <string>sultan.maiyaki</string> </c> <list reference="../c"/> </java.util.Collections_-UnmodifiableRandomAccessList>' where ID=10335;
GENERICCONFIGURATION.id = 10335
If upgrading to JIRA 5.1 and after you can alternatively use the below SQL as custom fields are stored differently. The above SQL will work as well.
update genericconfiguration set XMLVALUE='<list> <string>joachim.ooi</string> <string>justin.alex</string> <string>janet.albion</string> <string>chaiying.chan</string> <string>kahloun.foong</string> <string>voonkiat.gan</string> <string>ahmad.faisal</string> <string>ali.jawad</string> <string>muhammad.fahd</string> <string>sultan.maiyaki</string> </list>' where ID=10335;
- Restart JIRA in order for it to take effect.
Take note to perform a full data backup first before proceeding with database modification.