Nested exception is not thrown when wrapped inside ConfluenceEventDispatcher

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Low
    • None
    • Affects Version/s: 6.13.7
    • Component/s: Content - Page
    • None
    • 9
    • Severity 3 - Minor
    • 1

      Issue Summary

      Nested exception is not thrown when wrapped inside com.atlassian.confluence.event.ConfluenceEventDispatcher

      Steps to Reproduce

      • Issue occurred after following resolution steps for this bug: CONFSERVER-58605.

      Expected Results

      When there is a NullPointerException, we should be able to see in the logs the preceding stack/methods called, like this example:

      java.lang.RuntimeException: Listener: com.atlassian.confluence.links.RelatedContentRefactoringListener event: com.atlassian.confluence.event.events.content.page.PageMoveEvent
      	at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:50)
      	...
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      	at java.lang.Thread.run(Thread.java:748)
      Caused by: java.lang.NullPointerException
      	at java.util.Calendar.setTime(Calendar.java:1770)
      	at com.atlassian.confluence.pages.BlogPost.getPostingCalendarDate(BlogPost.java:134)
      

      We can see that this NPE was related to com.atlassian.confluence.pages.BlogPost.getPostingCalendarDate.

      Actual Results

      The below exception is thrown in the atlassian-confluence.log file, and it ends with Caused by: java.lang.NullPointerException:

      2019-10-24 15:39:59,439 ERROR [https-jsse-nio2-8443-exec-19] [atlassian.confluence.event.ConfluenceEventDispatcher] run There was an exception thrown trying to dispatch event [com.atlassian.confluence.event.events.content.page.PageMoveEvent@4ca9a9bd[theMover=ConfluenceUserImpl{name='user', key=8a8084026347e6f30163cb3dafcc004f},oldSpace=Space{key='SP'},oldParentPage=page: Parent Title v.3 (7867),oldPosition=<null>,movedBecauseOfParent=false,movedPageList=[page: Page Title v.6 (71304751)],page=page: Page Title v.6 (6789),suppressNotifications=false,timestamp=1571945998447]] from the invoker [SingleParameterMethodListenerInvoker{method=public void com.atlassian.confluence.links.RelatedContentRefactoringListener.handleEvent(com.atlassian.confluence.event.events.content.page.PageMoveEvent), listener=com.atlassian.confluence.links.RelatedContentRefactoringListener@4d18aa00} (timed)]
       -- referer: https://confluence.com/display/SP/pagetitle | url: /pages/movepage.action | traceId: b2ce1e11116363b2 | userName: user | action: movepage
      java.lang.RuntimeException: Listener: com.atlassian.confluence.links.RelatedContentRefactoringListener event: com.atlassian.confluence.event.events.content.page.PageMoveEvent
      	at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:50)
      	at com.atlassian.confluence.event.ConfluenceListenerHandlersConfiguration$TimedListenerInvoker.invoke(ConfluenceListenerHandlersConfiguration.java:96)
      	at com.atlassian.confluence.event.ConfluenceEventDispatcher$VCacheRequestContextRunnableFactory$1.lambda$run$0(ConfluenceEventDispatcher.java:93)
      	at com.atlassian.confluence.vcache.VCacheRequestContextOperations.lambda$doInRequestContext$0(VCacheRequestContextOperations.java:50)
      	at com.atlassian.confluence.impl.vcache.VCacheRequestContextManager.doInRequestContextInternal(VCacheRequestContextManager.java:87)
      	at com.atlassian.confluence.impl.vcache.VCacheRequestContextManager.doInRequestContext(VCacheRequestContextManager.java:71)
      	at com.atlassian.confluence.vcache.VCacheRequestContextOperations.doInRequestContext(VCacheRequestContextOperations.java:49)
      	at com.atlassian.confluence.event.ConfluenceEventDispatcher$VCacheRequestContextRunnableFactory$1.run(ConfluenceEventDispatcher.java:93)
      	at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:457)
      	at com.atlassian.event.internal.AsynchronousAbleEventDispatcher.dispatch(AsynchronousAbleEventDispatcher.java:88)
      	at com.atlassian.event.internal.EventPublisherImpl.invokeListeners(EventPublisherImpl.java:203)
      	at com.atlassian.event.internal.EventPublisherImpl.publish(EventPublisherImpl.java:114)
      	at com.atlassian.confluence.event.TimingEventPublisher.publish(TimingEventPublisher.java:76)
      	at com.atlassian.confluence.pages.DefaultPageManager.publishPageMoveEvents(DefaultPageManager.java:1689)
      	at com.atlassian.confluence.pages.DefaultPageManager.doMovePageAsChild(DefaultPageManager.java:1076)
      	at com.atlassian.confluence.pages.DefaultPageManager.lambda$null$15(DefaultPageManager.java:1036)
      	at com.atlassian.confluence.pages.DefaultPageManager.executeUnderLocks(DefaultPageManager.java:2005)
      	at com.atlassian.confluence.pages.DefaultPageManager.lambda$movePageAsChild$16(DefaultPageManager.java:1033)
      	at com.atlassian.confluence.pages.DefaultPageManager.executeWithLogging(DefaultPageManager.java:2033)
      	at com.atlassian.confluence.pages.DefaultPageManager.movePageAsChild(DefaultPageManager.java:1038)
      	...
      	at sun.nio.ch.Invoker$2.run(Invoker.java:218)
      	at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      	at java.lang.Thread.run(Thread.java:748)
      Caused by: java.lang.NullPointerException
      

      The stacktrace ends with Caused by: java.lang.NullPointerException. The nested exception is not thrown, and so we cannot see where the NULL is coming from.

      Workaround

      Currently there is no known workaround for this behavior. A workaround will be added here when available

            Assignee:
            Unassigned
            Reporter:
            Daniel Ponzio
            Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: