Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-16678

NPE in ScopeNotificationFilterClassMigrator while migrating from XWiki 9.7

    XMLWordPrintable

    Details

    • Difficulty:
      Unknown
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      Description

      As reported in this forum thread / post:

       https://forum.xwiki.org/t/help-with-update/5227/8

      the ScopeNotificationFilterClassMigrator might throw an NPE while migrating with a stack trace like:

      Caused by: 
      java.lang.NullPointerException
              at org.xwiki.notifications.filters.internal.migrators.ScopeNotificationFilterClassMigrator.generateNewXObject(ScopeNotificationFilterClassMigrator.java:169)
              at org.xwiki.notifications.filters.internal.migrators.ScopeNotificationFilterClassMigrator.migrateDocument(ScopeNotificationFilterClassMigrator.java:152)
              at org.xwiki.notifications.filters.internal.migrators.ScopeNotificationFilterClassMigrator.hibernateMigrate(ScopeNotificationFilterClassMigrator.java:125)
              at com.xpn.xwiki.store.migration.hibernate.AbstractHibernateDataMigration.migrate(AbstractHibernateDataMigration.java:118)
              at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.startMigrations(AbstractDataMigrationManager.java:837)
              at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.migrateDatabase(AbstractDataMigrationManager.java:736)
              at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.startMigrations(AbstractDataMigrationManager.java:657)
      

      I can reproduce the issue when I try to migrate a database from XWiki 9.7 while having some objects of class ##XWiki.Notifications.Code.NotificationPreferenceScopeClass## deleted manually from some user preferences pages.

      A simple null check should fix the issue.

       

        Attachments

          Activity

            People

            Assignee:
            camil7 Clemens Robbenhaar
            Reporter:
            camil7 Clemens Robbenhaar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Date of First Response: