List Pages Tree View Loads Forever
Symptoms
The list pages tree view in a particular space loads forever. Other spaces work fine. The log file contains this error:
2009-12-18 17:48:42,905 WARN [http-8080-2] [opensymphony.xwork.util.OgnlValueStack] findValue Caught an exception while evaluating expression 'JSONString' against value stack
-- space: 10059777 | url: /pages/children.action | page: 10027011 | userName: admin | referer: http://yourconfluenceurl/pages/listpages-dirview.action?key=spacekey | action: children
java.lang.RuntimeException: Caught an Ognl exception while getting property JSONString
java.lang.RuntimeException: Caught an Ognl exception while getting property JSONString
at com.opensymphony.xwork.util.CompoundRootAccessor.getProperty(CompoundRootAccessor.java:112)
at ognl.OgnlRuntime.getProperty(OgnlRuntime.java:1603)
at ognl.ASTProperty.getValueBody(ASTProperty.java:96)
:
:
/-- Encapsulated exception ------------\
java.lang.NullPointerException
at com.atlassian.confluence.pages.NaturalStringComparator.compareNatural(NaturalStringComparator.java:75)
at com.atlassian.confluence.pages.NaturalStringComparator.compareNatural(NaturalStringComparator.java:57)
at com.atlassian.confluence.pages.NaturalStringComparator.compare(NaturalStringComparator.java:42)
at com.atlassian.confluence.pages.Page$ChildPositionComparator.compare(Page.java:313)
at com.atlassian.confluence.pages.Page$ChildPositionComparator.compare(Page.java:282)
at java.util.Arrays.mergeSort(Arrays.java:1270)
at java.util.Arrays.mergeSort(Arrays.java:1282)
Cause
When accessing functionality that requires a page title comparison, Confluence will throw a NullPointerException if the page title is null.
Resolution
Identify the page title(s) that is null:
Run the following database query, to determine the pages with null titles:
SELECT c.CONTENTID FROM SPACES s, CONTENT c WHERE s.SPACEID = c.SPACEID AND s.SPACEKEY = '<your_space_key>' AND c.CONTENTTYPE = 'PAGE' AND c.TITLE IS NULL;
Note the contentids returned by this query.
If this query returns any data, do the following to update the title:
Update the page title:
Always back up your data before performing any modifications to the database. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.
- Stop Confluence.
Run the following query. Make sure that the titles are unique to the space:
update content set title = '<desired.title>' where contentid = <contentid>;
<contentid> is the contentid returned by the select query.
Restart Confluence.