Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-37055

Notifications from new Files viewer on MySQL and Oracle and SQL Server throws 'SQLException: You can't operate on a closed ResultSet!!!'

    XMLWordPrintable

Details

    Description

      Steps to Reproduce

      1. Set up Confluence 5.7 on MySQL or Oracle or SQL Server
      2. Configure a mail server
      3. Create a page, add a file and display it using the new Files viewer
      4. Save the page
      5. Add a pinned comment in the file
      6. The error will be thrown at this point. The URL will be a variant of /rest/files/1.0/files/655361/comments
      7. Add a comment to the page (not the file)
      8. The error will be thrown again. The URL will be 'url: /pages/docreatepage.action' despite the actual action being adding a page comment, not creating the page.

      The full stack trace is:

      2015-03-26 15:16:20,447 ERROR [NotificationSender:thread-2] [sf.hibernate.impl.IteratorImpl] next could not get next result
       -- referer: http://lachland.dyn.syd.atlassian.com:10570/confluence/display/TT/files?preview=/655362/655361/AusUnityClaimForm.pdf | url: /confluence/rest/files/1.0/files/655361/comments | userName: admin
      java.sql.SQLException: You can't operate on a closed ResultSet!!!
      	at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:106)
      	at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:65)
      	at com.mchange.v2.c3p0.impl.NewProxyResultSet.next(NewProxyResultSet.java:2865)
      	at net.sf.hibernate.impl.IteratorImpl.postNext(IteratorImpl.java:85)
      	at net.sf.hibernate.impl.IteratorImpl.next(IteratorImpl.java:127)
      	at com.google.common.collect.Iterators$8.next(Iterators.java:811)
      	at com.atlassian.confluence.plugins.files.manager.DefaultConfluenceFileManager.getUnresolvedCommentCountByAttachmentId(DefaultConfluenceFileManager.java:133)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
      	at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:58)
      	at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:62)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      	at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:56)
      	at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:39)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      	at org.springframework.osgi.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:59)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
      	at com.sun.proxy.$Proxy2519.getUnresolvedCommentCountByAttachmentId(Unknown Source)
      	at com.atlassian.confluence.plugins.files.notifications.email.FileContentUpdateRenderContextFactory.getFileContentForNotificationContent(FileContentUpdateRenderContextFactory.java:105)
      	at com.atlassian.confluence.plugins.files.notifications.email.FileContentUpdateRenderContextFactory.getFileContentsForNotificationContents(FileContentUpdateRenderContextFactory.java:83)
      	at com.atlassian.confluence.plugins.files.notifications.email.FileContentUpdateRenderContextFactory.createForRecipient(FileContentUpdateRenderContextFactory.java:55)
      	at com.atlassian.confluence.notifications.content.ContentRenderContextFactory.checkedCreate(ContentRenderContextFactory.java:61)
      	at com.atlassian.confluence.notifications.RenderContextProviderTemplate.create(RenderContextProviderTemplate.java:26)
      	at com.atlassian.confluence.notifications.impl.spi.DeclarativeRenderContextFactory.buildRecipientProviderContext(DeclarativeRenderContextFactory.java:191)
      	at com.atlassian.confluence.notifications.impl.spi.DeclarativeRenderContextFactory.access$400(DeclarativeRenderContextFactory.java:44)
      	at com.atlassian.confluence.notifications.impl.spi.DeclarativeRenderContextFactory$2.call(DeclarativeRenderContextFactory.java:139)
      	at com.atlassian.confluence.notifications.impl.spi.DeclarativeRenderContextFactory$2.call(DeclarativeRenderContextFactory.java:122)
      	at com.atlassian.confluence.user.AuthenticatedUserImpersonator$2.call(AuthenticatedUserImpersonator.java:134)
      	at com.atlassian.confluence.user.AuthenticatedUserImpersonator$1.call(AuthenticatedUserImpersonator.java:113)
      	at com.atlassian.confluence.user.AuthenticatedUserImpersonator.asUser(AuthenticatedUserImpersonator.java:89)
      	at com.atlassian.confluence.notifications.impl.spi.DeclarativeRenderContextFactory$1.call(DeclarativeRenderContextFactory.java:97)
      	at com.atlassian.confluence.notifications.impl.spi.DeclarativeRenderContextFactory$1.call(DeclarativeRenderContextFactory.java:94)
      	at com.atlassian.confluence.notifications.impl.DefaultFakeHttpRequestInjector$1.doFilter(DefaultFakeHttpRequestInjector.java:51)
      	at com.atlassian.core.filters.ServletContextThreadLocalFilter.doFilter(ServletContextThreadLocalFilter.java:21)
      	at com.atlassian.confluence.notifications.impl.DefaultFakeHttpRequestInjector.withRequest(DefaultFakeHttpRequestInjector.java:46)
      	at com.atlassian.confluence.notifications.impl.spi.DeclarativeRenderContextFactory.createChecked(DeclarativeRenderContextFactory.java:94)
      	at com.atlassian.plugin.notifications.api.medium.RenderContextFactoryTemplate.create(RenderContextFactoryTemplate.java:53)
      	at sun.reflect.GeneratedMethodAccessor856.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
      	at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:58)
      	at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:62)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      	at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:56)
      	at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:39)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      	at org.springframework.osgi.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:59)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
      	at com.sun.proxy.$Proxy1450.create(Unknown Source)
      	at com.atlassian.plugin.notifications.dispatcher.task.IndividualNotificationTask$UserKeySender.send(IndividualNotificationTask.java:157)
      	at com.atlassian.plugin.notifications.dispatcher.task.IndividualNotificationTask.execute(IndividualNotificationTask.java:64)
      	at com.atlassian.plugin.notifications.dispatcher.AbstractNotificationTask.run(AbstractNotificationTask.java:111)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
      	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: java.lang.NullPointerException
      	at com.mchange.v2.c3p0.impl.NewProxyResultSet.next(NewProxyResultSet.java:2859)
      	... 74 more
      

      Resolution

      Upgrade to Confluence 5.7.3 or above.

      NB: We do not recommend using the attached patch now that a version that contains the fix has been released.

      Attachments

        Issue Links

          Activity

            People

              nbhawnani Niraj Bhawnani
              dunterwurzacher Denise Unterwurzacher [Atlassian] (Inactive)
              Votes:
              6 Vote for this issue
              Watchers:
              25 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: