Thursday, 1 September 2011

Browse » Home » » » » Passed List Had More than One Value when Calling JIRA Dashboard

Passed List Had More than One Value when Calling JIRA Dashboard

Symptoms

Users trying to access the dashboard will encounter a System Error page containing an exception like the following:
java.lang.IllegalArgumentException: Passed List had more than one value.
at org.ofbiz.core.entity.EntityUtil.getOnly(EntityUtil.java:58)
at com.atlassian.jira.portal.OfBizPortalPageStore.getPortalPageByOwnerAndName(OfBizPortalPageStore.java:135)
at com.atlassian.jira.portal.CachingPortalPageStore.getPortalPageByOwnerAndName(CachingPortalPageStore.java:160)
at com.atlassian.jira.portal.DefaultPortalPageManager.getPortalPageByName(DefaultPortalPageManager.java:152)
at com.atlassian.jira.bc.portal.AbstractPortalPageService.validateForUpdate(AbstractPortalPageService.java:401)
at com.atlassian.jira.dashboard.permission.JiraPermissionService.isWritableBy(JiraPermissionService.java:63)
at com.atlassian.jira.dashboard.permission.JiraGadgetPermissionManager.filterGadgets(JiraGadgetPermissionManager.java:54)
...
Application logs also contain the following ERROR report:
...
2010-04-12 16:58:19,140 http-8080-Processor24 ERROR f97048 61099x220x1 hn6601 http://localhost:8080/secure/Dashboard.jspa [500ErrorPage.jsp] Exception caught in 500 page Passed List had more than one value.
java.lang.IllegalArgumentException: Passed List had more than one value.
    at org.ofbiz.core.entity.EntityUtil.getOnly(EntityUtil.java:58)
    at com.atlassian.jira.portal.OfBizPortalPageStore.getPortalPageByOwnerAndName(OfBizPortalPageStore.java:135)
    at com.atlassian.jira.portal.CachingPortalPageStore.getPortalPageByOwnerAndName(CachingPortalPageStore.java:160)
...

Diagnosis

Further proof can be determined with the following query, as any resulting user will be affected by the problem:
SELECT username, pagename, count(pagename) FROM portalpage GROUP BY username,pagename HAVING count(pagename) > 1;

Cause

The portalpage table is used to store user's dashboard. Normally, it should contain one different pagename for each user. It should not contain names of duplicated pages per user. If there are duplicates, the "Passed List had more than one value" exception will occur.
Here is the code from OfBizPortalPageStore, where the application is expecting a single value from the underlying database:
final GenericValue pageGV = EntityUtil.getOnly(delegator.findByAnd(Table.NAME, EasyMap.build(Column.USERNAME, owner.getName(), Column.PAGENAME, name), DEFAULT_ORDER_BY_CLAUSE));

Resolution

Remove the duplicate tuples from the portalpage table by using the username and pagename column. Use the diagnosis section above for reference.

Advertisement:

No comments:

Post a Comment

Note: only a member of this blog may post a comment.