Uploaded image for project: 'XWiki Commons'
  1. XWiki Commons
  2. XCOMMONS-2717

NPE in case of malformed XML history file

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 14.10.11
    • Extension
    • None
    • Unknown

    Description

      If an XML history file is malformed (e.g. it's not finished, see below), the DefaultExtensionJobHistory wrongly produces a NPE instead of informing about the malformed XML, with the following stacktrace:

      2023-05-25 16:34:29,372 [main] ERROR h.i.DefaultExtensionJobHistory - Failed to read extension job history from [/var/lib/xwiki/data/extension/history/2022.01.22.xml]. 
      java.lang.NullPointerException: null
      	at java.base/java.util.Collections.reverse(Collections.java:379)
      	at org.xwiki.extension.job.history.internal.DefaultExtensionJobHistory.load(DefaultExtensionJobHistory.java:176)
      	at org.xwiki.extension.job.history.internal.DefaultExtensionJobHistory.initialize(DefaultExtensionJobHistory.java:112)
      

      Example of such malformed XML:

      </org.xwiki.extension.job.history.ExtensionJobHistoryRecord><org.xwiki.extension.job.history.ExtensionJobHistoryRecord>
        <jobType>searchflavors</jobType>
        <request class="org.xwiki.platform.flavor.job.FlavorSearchRequest">
          <id>
            <string>flavor</string>
            <string>search</string>
            <string>wiki:subwiki</string>
          </id>
          <properties>
            <entry>
              <string>extensions</string>
              <list/>
            </entry>
            <entry>
              <string>extensio
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            surli Simon Urli
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: