Uploaded image for project: 'Confluence Server and Data Center'
  1. Confluence Server and Data Center
  2. CONFSERVER-45592

rest/watch-button/1.0/watchState/ is Triggered for Versioned Content Leading to NPE stack traces

    XMLWordPrintable

Details

    Description

      Summary

      Navigate through the a page history while having your browser's dev console/network tabs open and notice the unnecessary (or broken) rest call made to
      http://localhost:8080/confluence/rest/watch-button/1.0/watchState/2147745911

      Steps to Reproduce

      1. Watch a page
      2. Edit the page to have another version
      3. Go to Page History and click on a older version

      Expected Results

      • Nothing shows in the logs.

      Actual Results

      The below exception is thrown in the atlassian-confluence.log file:

      2015-11-16 15:06:11,767 ERROR [http-nio-8080-exec-5] [common.error.jersey.ThrowableExceptionMapper] toResponse Uncaught exception thrown by REST service: null
       -- referer: http://localhost:8080/confluence/pages/viewpage.action?pageId=2147745911&navigatingVersions=true | url: /confluence/rest/watch-button/1.0/watchState/2147745911 | userName: admin
      java.lang.NullPointerException
      	at com.atlassian.confluence.mail.notification.persistence.dao.hibernate.HibernateNotificationDao.findNotificationByUserAndSpaceAndType(HibernateNotificationDao.java:192)
      	at com.atlassian.confluence.impl.mail.notification.persistence.DelegatingNotificationDao.findNotificationByUserAndSpaceAndType(DelegatingNotificationDao.java:122)
      	at com.atlassian.confluence.mail.notification.DefaultNotificationManager.getNotificationByUserAndSpace(DefaultNotificationManager.java:71)
      	at sun.reflect.GeneratedMethodAccessor1171.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:497)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
      	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      	at com.atlassian.spring.interceptors.SpringProfilingInterceptor.invoke(SpringProfilingInterceptor.java:16)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      	at com.atlassian.confluence.util.profiling.ConfluenceMonitoringMethodInterceptor.invoke(ConfluenceMonitoringMethodInterceptor.java:40)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
      	at com.sun.proxy.$Proxy98.getNotificationByUserAndSpace(Unknown Source)
      	at sun.reflect.GeneratedMethodAccessor1171.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:497)
      	at com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvocationHandler.java:26)
      	at com.sun.proxy.$Proxy432.getNotificationByUserAndSpace(Unknown Source)
      	at sun.reflect.GeneratedMethodAccessor1171.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:497)
      	at com.atlassian.plugin.osgi.bridge.external.HostComponentFactoryBean$DynamicServiceInvocationHandler.invoke(HostComponentFactoryBean.java:136)
      	at com.sun.proxy.$Proxy432.getNotificationByUserAndSpace(Unknown Source)
      	at com.atlassian.confluence.plugins.watch.WatchStateResource.buildWatchState(WatchStateResource.java:71)
      	at com.atlassian.confluence.plugins.watch.WatchStateResource.lambda$getWatchState$3(WatchStateResource.java:59)
      	at com.atlassian.confluence.plugins.watch.WatchStateResource$$Lambda$383/1116145577.apply(Unknown Source)
      	at java.util.Optional.map(Optional.java:215)
      	at com.atlassian.confluence.plugins.watch.WatchStateResource.getWatchState(WatchStateResource.java:59)
      	at sun.reflect.GeneratedMethodAccessor1588.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:497)
      	at com.atlassian.plugins.rest.common.interceptor.impl.DispatchProviderHelper$ResponseOutInvoker$1.invoke(DispatchProviderHelper.java:234)
      	at com.atlassian.plugins.rest.common.interceptor.impl.DispatchProviderHelper$1.intercept(DispatchProviderHelper.java:100)
      	at com.atlassian.plugins.rest.common.interceptor.impl.DefaultMethodInvocation.invoke(DefaultMethodInvocation.java:61)
      	at com.atlassian.plugins.rest.common.expand.interceptor.ExpandInterceptor.intercept(ExpandInterceptor.java:38)
      	at com.atlassian.plugins.rest.common.interceptor.impl.DefaultMethodInvocation.invoke(DefaultMethodInvocation.java:61)
      	at com.atlassian.plugins.rest.common.interceptor.impl.DispatchProviderHelper.invokeMethodWithInterceptors(DispatchProviderHelper.java:132)
      	at com.atlassian.plugins.rest.common.interceptor.impl.DispatchProviderHelper$ResponseOutInvoker._dispatch(DispatchProviderHelper.java:230)
      	at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
      	at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:288)
      	at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
      	at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
      	at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
      	at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
      	at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1469)
      	at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1400)
      	at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349)
      	at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339)
      	at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)
      	at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537)
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            emallmann Eduardo Mallmann (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: