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

NPE when logout from a page with Notifications Macro

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 10.5-rc-1, 9.11.6
    • 10.4
    • Notifications
    • None
    • Windows 10 Pro 64 bit, Chrome 66, using a local instance of XWiki 10.4 on PostgreSQL 10
    • Unknown
    • N/A
    • N/A

    Description

      STEPS TO REPRODUCE

      1. Login as Admin
      2. Go to Notifications > Settings and set Pages Notifications to ON
      3. Set 'Own Events Filter' to OFF
      4. Create/update/comment a page
      5. Edit a page with CKEditor
      6. Search for Notifications Macro
      7. Tick 'Use the preferences of the user'
      8. Click 'Submit'
      9. Click 'Save & View'
      10. Log out

      EXPECTED RESULTS

      The Admin is successfully logout.

      ACTUAL RESULTS

      After the Admin logs out, an endlessly spinning wheel is displayed in the place of the Notifications Macro and a NullPointerException is encountered in console, having the following stacktrace:

      Mai 23, 2018 12:58:23 PM org.restlet.engine.application.StatusFilter doHandle
      WARNING: Exception or error caught by status service
      java.lang.NullPointerException
              at org.xwiki.notifications.preferences.internal.DefaultModelBridge.getNotificationPreferences(DefaultModelBridge.java:131)
              at org.xwiki.notifications.preferences.internal.DefaultModelBridge.getNotificationsPreferences(DefaultModelBridge.java:107)
              at org.xwiki.notifications.preferences.internal.CachedModelBridge.getNotificationsPreferences(CachedModelBridge.java:79)
              at org.xwiki.notifications.preferences.internal.UserProfileNotificationPreferenceProvider.getPreferencesForUser(UserProfileNotificationPreferenceProvider.java:63)
              at org.xwiki.notifications.preferences.internal.DefaultNotificationPreferenceManager.getAllPreferences(DefaultNotificationPreferenceManager.java:97)
              at org.xwiki.notifications.preferences.internal.DefaultNotificationPreferenceManager.getPreferences(DefaultNotificationPreferenceManager.java:120)
              at org.xwiki.notifications.rest.internal.DefaultNotificationsResource.useUserPreferences(DefaultNotificationsResource.java:177)
              at org.xwiki.notifications.rest.internal.DefaultNotificationsResource.getNotifications(DefaultNotificationsResource.java:136)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
              at org.restlet.ext.jaxrs.internal.wrappers.AbstractMethodWrapper.internalInvoke(AbstractMethodWrapper.java:162)
              at org.restlet.ext.jaxrs.internal.wrappers.ResourceMethod.invoke(ResourceMethod.java:281)
              at org.restlet.ext.jaxrs.JaxRsRestlet.invokeMethod(JaxRsRestlet.java:997)
              at org.restlet.ext.jaxrs.JaxRsRestlet.handle(JaxRsRestlet.java:746)
              at org.restlet.routing.Filter.doHandle(Filter.java:150)
              at org.restlet.routing.Filter.handle(Filter.java:197)
              at org.restlet.routing.Router.doHandle(Router.java:422)
              at org.restlet.routing.Router.handle(Router.java:641)
              at org.restlet.routing.Filter.doHandle(Filter.java:150)
              at org.restlet.routing.Filter.handle(Filter.java:197)
              at org.restlet.routing.Filter.doHandle(Filter.java:150)
              at org.restlet.routing.Filter.handle(Filter.java:197)
              at org.restlet.routing.Filter.doHandle(Filter.java:150)
              at org.restlet.routing.Filter.handle(Filter.java:197)
              at org.restlet.routing.Filter.doHandle(Filter.java:150)
              at org.restlet.routing.Filter.handle(Filter.java:197)
              at org.restlet.routing.Filter.doHandle(Filter.java:150)
              at org.restlet.engine.application.StatusFilter.doHandle(StatusFilter.java:140)
              at org.restlet.routing.Filter.handle(Filter.java:197)
              at org.restlet.routing.Filter.doHandle(Filter.java:150)
              at org.restlet.routing.Filter.handle(Filter.java:197)
              at org.restlet.engine.CompositeHelper.handle(CompositeHelper.java:202)
              at org.restlet.engine.application.ApplicationHelper.handle(ApplicationHelper.java:77)
              at org.restlet.Application.handle(Application.java:385)
              at org.restlet.routing.Filter.doHandle(Filter.java:150)
              at org.restlet.routing.Filter.handle(Filter.java:197)
              at org.restlet.routing.Router.doHandle(Router.java:422)
              at org.restlet.routing.Router.handle(Router.java:641)
              at org.restlet.routing.Filter.doHandle(Filter.java:150)
              at org.restlet.routing.Filter.handle(Filter.java:197)
              at org.restlet.routing.Router.doHandle(Router.java:422)
              at org.restlet.routing.Router.handle(Router.java:641)
              at org.restlet.routing.Filter.doHandle(Filter.java:150)
              at org.restlet.routing.Filter.handle(Filter.java:197)
              at org.restlet.engine.CompositeHelper.handle(CompositeHelper.java:202)
              at org.restlet.Component.handle(Component.java:408)
              at org.restlet.Server.handle(Server.java:507)
              at org.restlet.engine.connector.ServerHelper.handle(ServerHelper.java:63)
              at org.restlet.engine.adapter.HttpServerHelper.handle(HttpServerHelper.java:143)
              at org.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:1117)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
              at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:860)
              at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650)
              at org.xwiki.wysiwyg.filter.XWikiContextInitializationFilter.doFilter(XWikiContextInitializationFilter.java:85)
              at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
              at org.xwiki.container.servlet.filters.internal.SetHTTPHeaderFilter.doFilter(SetHTTPHeaderFilter.java:63)
              at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
              at org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208)
              at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
              at org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111)
              at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
              at org.xwiki.resource.servlet.RoutingFilter.doFilter(RoutingFilter.java:134)
              at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1629)
              at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533)
              at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
              at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
              at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
              at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:190)
              at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
              at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
              at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)
              at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)
              at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
              at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
              at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)
              at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1155)
              at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
              at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:219)
              at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)
              at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
              at org.eclipse.jetty.server.Server.handle(Server.java:530)
              at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:347)
              at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:256)
              at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
              at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
              at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
              at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:247)
              at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:140)
              at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
              at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:382)
              at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:708)
              at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:626)
              at java.lang.Thread.run(Thread.java:748) 

      Attachments

        Issue Links

          Activity

            People

              gdelhumeau Guillaume Delhumeau
              iandriuta Ilie Andriuta
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: