Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-8600

Exporting a Space sometimes fails, throwing a Nullpointer-Exception

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: High High
    • 2.6.0
    • 2.5.2
    • None

      During a space export you can sometimes get this stack trace:

      com.atlassian.confluence.importexport.ImportExportException: Couldn't backup database data.
      at com.atlassian.confluence.importexport.impl.AbstractXmlExporter.backupEntities(AbstractXmlExporter.java:181)
      at com.atlassian.confluence.importexport.impl.AbstractXmlExporter.backupEverything(AbstractXmlExporter.java:85)
      at com.atlassian.confluence.importexport.impl.FileXmlExporter.backupEverything(FileXmlExporter.java:73)
      ...
      Caused by: java.lang.NullPointerException
      at com.atlassian.confluence.security.ContentPermission.compareTo(ContentPermission.java:210)
      at java.util.TreeMap.compare(TreeMap.java:1093)
      at java.util.TreeMap.put(TreeMap.java:465)
      at java.util.TreeSet.add(TreeSet.java:210)

      NB. Mostly you just get this error:
      'The page you were trying to reach does not exist. You may want to try a search, or browse the site to find the page you were looking for.'

            [CONFSERVER-8600] Exporting a Space sometimes fails, throwing a Nullpointer-Exception

            Ivan Benko [Atlassian] added a comment - - edited

            I confirm that the file is available in both versions, 2.7 and 2.8 source distribution.
            ...confluence/src/etc/java/com/atlassian/confluence/security/ContentPermissionSet.hbm.xml

            In the downloaded package it is located in the confluence-2.8.2-std/confluence/WEB-INF/lib/confluence-2.8.2.jar Similarly for version 2.7

            You will need to extract and recreate the jar file and dropping it into the designated location.
            This guide will help: http://confluence.atlassian.com/display/DOC/Editing+files+within+.jar+archives

            Ivan Benko [Atlassian] added a comment - - edited I confirm that the file is available in both versions, 2.7 and 2.8 source distribution. ...confluence/src/etc/java/com/atlassian/confluence/security/ContentPermissionSet.hbm.xml In the downloaded package it is located in the confluence-2.8.2-std/confluence/WEB-INF/lib/confluence-2.8.2.jar Similarly for version 2.7 You will need to extract and recreate the jar file and dropping it into the designated location. This guide will help: http://confluence.atlassian.com/display/DOC/Editing+files+within+.jar+archives

            PaulC added a comment -

            We can't seem to find the "ContentPermissionSet.hbm.xml" file in 2.8.1
            Is the setting stored somewhere else?

            regards,
            Paul

            PaulC added a comment - We can't seem to find the "ContentPermissionSet.hbm.xml" file in 2.8.1 Is the setting stored somewhere else? regards, Paul

            PaulC added a comment -

            Hi, is this Lazy setting still configurable in 2.7, 2.8.x or above?
            We cant seem to locate that file.

            regards,
            Paul

            PaulC added a comment - Hi, is this Lazy setting still configurable in 2.7, 2.8.x or above? We cant seem to locate that file. regards, Paul

            This fix worked for us in a V2.5.4 install as well.

            Huw Evans (Adaptavist.com) added a comment - This fix worked for us in a V2.5.4 install as well.

            resolving this issue again. the other problem Gurleen mentioned will get a separate bug with a link to this one.

            Per Fragemann [Atlassian] added a comment - resolving this issue again. the other problem Gurleen mentioned will get a separate bug with a link to this one.

            This fixed my export problem. Thank you very much for the fix!!!

            Stephen Morad added a comment - This fixed my export problem. Thank you very much for the fix!!!

            To patch this manually, change the following in confluence/WEB-INF/classes/com/atlassian/confluence/security/ContentPermissionSet.hbm.xml:

            <set name="contentPermissions" lazy="false" ...
            

            change the lazy value to true in the above line, like this:

            <set name="contentPermissions" lazy="true" ...
            

            Note that is a tentative fix. We haven't heard any more problems, but this isn't a confirmed resolution. Please let us know if you can verify that this fixes the problem.

            m@ (Inactive) added a comment - To patch this manually, change the following in confluence/WEB-INF/classes/com/atlassian/confluence/security/ContentPermissionSet.hbm.xml : <set name= "contentPermissions" lazy= "false" ... change the lazy value to true in the above line, like this: <set name= "contentPermissions" lazy= "true" ... Note that is a tentative fix. We haven't heard any more problems, but this isn't a confirmed resolution. Please let us know if you can verify that this fixes the problem.

            I've taken the advice from the hibernate FAQ linked to above and made the ContentPermissionSet a lazily loaded collection. Marking issue as (tentatively) resolved. Please reopen if you get another occurence of this issue in 2.6.

            Christopher Owen [Atlassian] added a comment - I've taken the advice from the hibernate FAQ linked to above and made the ContentPermissionSet a lazily loaded collection. Marking issue as (tentatively) resolved. Please reopen if you get another occurence of this issue in 2.6.

            The null pointer exception is probably because of the unspecified performance optimisation hinted to at http://www.hibernate.org/117.html#A19

            The solution for this problem is apparently to make the collection lazy loaded.

            Christopher Owen [Atlassian] added a comment - The null pointer exception is probably because of the unspecified performance optimisation hinted to at http://www.hibernate.org/117.html#A19 The solution for this problem is apparently to make the collection lazy loaded.

            I will need to do a space export this week (for Confluence doc updates). Early next week at very latest.

            Rosie Jameson [Atlassian] (Inactive) added a comment - I will need to do a space export this week (for Confluence doc updates). Early next week at very latest.

              Unassigned Unassigned
              mjensen m@ (Inactive)
              Affected customers:
              2 This affects my team
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: