java.sql.SQLException: Parameter index out of range (51 > number of parameters, which is 50).

Atlassian JIRA | Julian Rahmadiputra [Atlassian] | 2 years ago
  1. 0

    h3. Summary When configuring Global Filters for Activity Streams, the username textbox is a free text field. Adding more than one user separated by commas causes a SQL Exception in the logs. h3. Steps to Reproduce # Add an Activity Stream to a Dashboard # Add a Global filter with the configuration below: #* {{Username}} {{is/is not}} \[*user1, user2*\] Obs: The usernames may be valid or invalid ones and the exception still happens. h3. Expected Results No exception in the logs. h3. Actual Results The following exception is thrown in the atlassian-jira.log file: *MySQL:* {noformat} 2015-01-14 15:58:09,739 StreamsCompletionService::thread-21 ERROR admin 958x1381x1 158u8c6 10.60.4.135 /plugins/servlet/streams [atlassian.streams.internal.LocalActivityProvider] Exception building feed com.atlassian.activeobjects.internal.ActiveObjectsSqlException: There was a SQL exception thrown by the Active Objects library: Database: - name:MySQL - version:5.6.21-log - minor version:6 - major version:5 Driver: - name:MySQL Connector Java - version:mysql-connector-java-5.1.26 ( Revision: ${bzr.revision-id} ) java.sql.SQLException: Parameter index out of range (51 > number of parameters, which is 50). at com.atlassian.activeobjects.internal.EntityManagedActiveObjects.find(EntityManagedActiveObjects.java:179) at com.atlassian.activeobjects.osgi.DelegatingActiveObjects.find(DelegatingActiveObjects.java:93) <+2> {noformat} *PostgreSQL* {noformat} 2015-10-21 15:59:30,806 StreamsCompletionService::thread-1993 ERROR admin 959x74842x1 17b6pej 192.168.10.137 /plugins/servlet/streams [atlassian.streams.internal.LocalActivityProvider] Exception building feed com.atlassian.activeobjects.internal.ActiveObjectsSqlException: There was a SQL exception thrown by the Active Objects library: Database: - name:PostgreSQL - version:9.4.0 - minor version:4 - major version:9 Driver: - name:PostgreSQL Native Driver - version:PostgreSQL 9.0 JDBC4 (build 801) org.postgresql.util.PSQLException: The column index is out of range: 65, number of columns: 64. at com.atlassian.activeobjects.internal.EntityManagedActiveObjects.find(EntityManagedActiveObjects.java:185) at com.atlassian.activeobjects.osgi.TenantAwareActiveObjects.find(TenantAwareActiveObjects.java:335) <+2> (DelegatingMethodAccessorImpl.java:43) {noformat} *PostgreSQL (JIRA 7)* {noformat} 2015-10-21 16:00:59,187 StreamsCompletionService::thread-98 ERROR admin 960x4399x1 az6hzx 192.168.10.174 /plugins/servlet/streams [c.a.streams.internal.LocalActivityProvider] Exception building feed com.atlassian.activeobjects.internal.ActiveObjectsSqlException: There was a SQL exception thrown by the Active Objects library: Database: - name:PostgreSQL - version:9.4.0 - minor version:4 - major version:9 Driver: - name:PostgreSQL Native Driver - version:PostgreSQL 9.0 JDBC4 (build 801) org.postgresql.util.PSQLException: The column index is out of range: 14, number of columns: 13. at com.atlassian.activeobjects.internal.EntityManagedActiveObjects.find(EntityManagedActiveObjects.java:136) at com.atlassian.activeobjects.osgi.TenantAwareActiveObjects.find(TenantAwareActiveObjects.java:291) {noformat} h3. Notes Although the exception is written to the logs, the Activity Stream applies the global filter correctly. h3.Workaround (!) *Important*: This workaround might prevent troubleshooting real problems with the Activity Stream, since *any errors will be suppressed*. [Set the logging level|https://confluence.atlassian.com/display/JIRAKB/How+to+set+logging+level+for+a+package+in+JIRA] for the package below to {{OFF}}: * {{atlassian.streams.internal.LocalActivityProvider}}

    Atlassian JIRA | 2 years ago | Julian Rahmadiputra [Atlassian]
    java.sql.SQLException: Parameter index out of range (51 > number of parameters, which is 50).
  2. 0

    h3. Summary When configuring Global Filters for Activity Streams, the username textbox is a free text field. Adding more than one user separated by commas causes a SQL Exception in the logs. h3. Steps to Reproduce # Add an Activity Stream to a Dashboard # Add a Global filter with the configuration below: #* {{Username}} {{is/is not}} \[*user1, user2*\] Obs: The usernames may be valid or invalid ones and the exception still happens. h3. Expected Results No exception in the logs. h3. Actual Results The following exception is thrown in the atlassian-jira.log file: *MySQL:* {noformat} 2015-01-14 15:58:09,739 StreamsCompletionService::thread-21 ERROR admin 958x1381x1 158u8c6 10.60.4.135 /plugins/servlet/streams [atlassian.streams.internal.LocalActivityProvider] Exception building feed com.atlassian.activeobjects.internal.ActiveObjectsSqlException: There was a SQL exception thrown by the Active Objects library: Database: - name:MySQL - version:5.6.21-log - minor version:6 - major version:5 Driver: - name:MySQL Connector Java - version:mysql-connector-java-5.1.26 ( Revision: ${bzr.revision-id} ) java.sql.SQLException: Parameter index out of range (51 > number of parameters, which is 50). at com.atlassian.activeobjects.internal.EntityManagedActiveObjects.find(EntityManagedActiveObjects.java:179) at com.atlassian.activeobjects.osgi.DelegatingActiveObjects.find(DelegatingActiveObjects.java:93) <+2> {noformat} *PostgreSQL* {noformat} 2015-10-21 15:59:30,806 StreamsCompletionService::thread-1993 ERROR admin 959x74842x1 17b6pej 192.168.10.137 /plugins/servlet/streams [atlassian.streams.internal.LocalActivityProvider] Exception building feed com.atlassian.activeobjects.internal.ActiveObjectsSqlException: There was a SQL exception thrown by the Active Objects library: Database: - name:PostgreSQL - version:9.4.0 - minor version:4 - major version:9 Driver: - name:PostgreSQL Native Driver - version:PostgreSQL 9.0 JDBC4 (build 801) org.postgresql.util.PSQLException: The column index is out of range: 65, number of columns: 64. at com.atlassian.activeobjects.internal.EntityManagedActiveObjects.find(EntityManagedActiveObjects.java:185) at com.atlassian.activeobjects.osgi.TenantAwareActiveObjects.find(TenantAwareActiveObjects.java:335) <+2> (DelegatingMethodAccessorImpl.java:43) {noformat} *PostgreSQL (JIRA 7)* {noformat} 2015-10-21 16:00:59,187 StreamsCompletionService::thread-98 ERROR admin 960x4399x1 az6hzx 192.168.10.174 /plugins/servlet/streams [c.a.streams.internal.LocalActivityProvider] Exception building feed com.atlassian.activeobjects.internal.ActiveObjectsSqlException: There was a SQL exception thrown by the Active Objects library: Database: - name:PostgreSQL - version:9.4.0 - minor version:4 - major version:9 Driver: - name:PostgreSQL Native Driver - version:PostgreSQL 9.0 JDBC4 (build 801) org.postgresql.util.PSQLException: The column index is out of range: 14, number of columns: 13. at com.atlassian.activeobjects.internal.EntityManagedActiveObjects.find(EntityManagedActiveObjects.java:136) at com.atlassian.activeobjects.osgi.TenantAwareActiveObjects.find(TenantAwareActiveObjects.java:291) {noformat} h3. Notes Although the exception is written to the logs, the Activity Stream applies the global filter correctly. h3.Workaround (!) *Important*: This workaround might prevent troubleshooting real problems with the Activity Stream, since *any errors will be suppressed*. [Set the logging level|https://confluence.atlassian.com/display/JIRAKB/How+to+set+logging+level+for+a+package+in+JIRA] for the package below to {{OFF}}: * {{atlassian.streams.internal.LocalActivityProvider}}

    Atlassian JIRA | 2 years ago | Julian Rahmadiputra [Atlassian]
    java.sql.SQLException: Parameter index out of range (51 > number of parameters, which is 50).
  3. 0

    When I select an existing user during agent creation an SQL Exception is thrown by the Active Objects library, see attached screenshot. In the atlassian-jira.log file I found the following information: {noformat} 2014-10-17 11:40:40,452 ajp-bio-8009-exec-1 ERROR WAGNERDA 700x1062x1 1oe094s 10.20.24.4 /rest/servicedesk/1/servicedesk/admin/agent/promote [common.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service: There was a SQL exception thrown by the Active Objects library: Database: - name:Microsoft SQL Server - version:10.50.4033 - minor version:50 - major version:10 Driver: - name:jTDS Type 4 JDBC Driver for MS SQL Server and Sybase - version:1.2.4 java.sql.SQLException: Incorrect syntax near '-'. com.atlassian.activeobjects.internal.ActiveObjectsSqlException: There was a SQL exception thrown by the Active Objects library: Database: - name:Microsoft SQL Server - version:10.50.4033 - minor version:50 - major version:10 Driver: - name:jTDS Type 4 JDBC Driver for MS SQL Server and Sybase - version:1.2.4 java.sql.SQLException: Incorrect syntax near '-'. at com.atlassian.activeobjects.internal.EntityManagedActiveObjects.find(EntityManagedActiveObjects.java:179) at com.atlassian.activeobjects.osgi.DelegatingActiveObjects.find(DelegatingActiveObjects.java:93) <+2> at java.lang.reflect.Method.invoke(Unknown Source) 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.$Proxy3799.find(Unknown Source) at com.atlassian.activeobjects.scala.TypedActiveObjects.find(TypedActiveObjects.scala:13) at com.atlassian.servicedesk.internal.feature.servicedesk.ServiceDeskStore.getServiceDesks(ServiceDeskStore.scala:123) at com.atlassian.servicedesk.internal.feature.servicedesk.ServiceDeskStore.getServiceDeskWithLimit(ServiceDeskStore.scala:37) at com.atlassian.servicedesk.internal.feature.servicedesk.ServiceDeskManager.getMoreServiceDesks$1(ServiceDeskManager.scala:188) at com.atlassian.servicedesk.internal.feature.servicedesk.ServiceDeskManager.getServiceDesksLimited(ServiceDeskManager.scala:196) at com.atlassian.servicedesk.internal.feature.servicedesk.ServiceDeskService.getServiceDesksVisibleAsAgent(ServiceDeskService.scala:61) at com.atlassian.servicedesk.internal.feature.servicedesk.ServiceDeskService.getAllServiceDeskVisibleAsAgent(ServiceDeskService.scala:66) at com.atlassian.servicedesk.internal.feature.usermanagement.ServiceDeskTeamManager.getServiceDeskProjectsViewableByUser$1(ServiceDeskTeamManager.scala:45) at com.atlassian.servicedesk.internal.feature.usermanagement.ServiceDeskTeamManager.sendInviteForExistingAllocation(ServiceDeskTeamManager.scala:50) at com.atlassian.servicedesk.internal.feature.usermanagement.ServiceDeskTeamService.sendInviteForExistingAllocation(ServiceDeskTeamService.scala:50) at com.atlassian.servicedesk.internal.rest.ServiceDeskAgentResource$$anonfun$4$$anonfun$apply$17$$anonfun$apply$18$$anonfun$apply$19$$anonfun$apply$20.apply(ServiceDeskAgentResource.scala:114) at com.atlassian.servicedesk.internal.rest.ServiceDeskAgentResource$$anonfun$4$$anonfun$apply$17$$anonfun$apply$18$$anonfun$apply$19$$anonfun$apply$20.apply(ServiceDeskAgentResource.scala:112) at scalaz.Validation$class.map(Validation.scala:114) at scalaz.Success.map(Validation.scala:347) at com.atlassian.servicedesk.internal.rest.ServiceDeskAgentResource$$anonfun$4$$anonfun$apply$17$$anonfun$apply$18$$anonfun$apply$19.apply(ServiceDeskAgentResource.scala:112) at com.atlassian.servicedesk.internal.rest.ServiceDeskAgentResource$$anonfun$4$$anonfun$apply$17$$anonfun$apply$18$$anonfun$apply$19.apply(ServiceDeskAgentResource.scala:111) at scalaz.Validation$class.flatMap(Validation.scala:141) at scalaz.Success.flatMap(Validation.scala:347) at com.atlassian.servicedesk.internal.rest.ServiceDeskAgentResource$$anonfun$4$$anonfun$apply$17$$anonfun$apply$18.apply(ServiceDeskAgentResource.scala:111) at com.atlassian.servicedesk.internal.rest.ServiceDeskAgentResource$$anonfun$4$$anonfun$apply$17$$anonfun$apply$18.apply(ServiceDeskAgentResource.scala:110) at scalaz.Validation$class.flatMap(Validation.scala:141) at scalaz.Success.flatMap(Validation.scala:347) at com.atlassian.servicedesk.internal.rest.ServiceDeskAgentResource$$anonfun$4$$anonfun$apply$17.apply(ServiceDeskAgentResource.scala:110) at com.atlassian.servicedesk.internal.rest.ServiceDeskAgentResource$$anonfun$4$$anonfun$apply$17.apply(ServiceDeskAgentResource.scala:109) at scalaz.Validation$class.flatMap(Validation.scala:141) at scalaz.Success.flatMap(Validation.scala:347) at com.atlassian.servicedesk.internal.rest.ServiceDeskAgentResource$$anonfun$4.apply(ServiceDeskAgentResource.scala:109) at com.atlassian.servicedesk.internal.rest.ServiceDeskAgentResource$$anonfun$4.apply(ServiceDeskAgentResource.scala:108) at scalaz.Validation$class.flatMap(Validation.scala:141) at scalaz.Success.flatMap(Validation.scala:347) at com.atlassian.servicedesk.internal.rest.ServiceDeskAgentResource.promoteUserToAgent(ServiceDeskAgentResource.scala:108) <+3> at java.lang.reflect.Method.invoke(Unknown Source) <+19> (DispatchProviderHelper.java:234) (DispatchProviderHelper.java:100) (DefaultMethodInvocation.java:61) (ExpandInterceptor.java:38) (DefaultMethodInvocation.java:61) (DispatchProviderHelper.java:132) (DispatchProviderHelper.java:230) (ResourceJavaMethodDispatcher.java:75) (HttpMethodRule.java:288) (RightHandPathRule.java:147) (ResourceClassRule.java:108) (RightHandPathRule.java:147) (RootResourceClassesRule.java:84) (WebApplicationImpl.java:1469) (WebApplicationImpl.java:1400) (WebApplicationImpl.java:1349) (WebApplicationImpl.java:1339) (WebComponent.java:416) (ServletContainer.java:537) at com.atlassian.plugins.rest.module.RestDelegatingServletFilter$JerseyOsgiServletContainer.doFilter(RestDelegatingServletFilter.java:178) <+1> (ServletContainer.java:795) at com.atlassian.plugins.rest.module.RestDelegatingServletFilter.doFilter(RestDelegatingServletFilter.java:73) <+16> (DelegatingPluginFilter.java:78) (IteratingFilterChain.java:42) (ServletFilterModuleContainerFilter.java:77) (ServletFilterModuleContainerFilter.java:63) (DelegatingPluginFilter.java:78) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:70) (RestServletUtilsUpdaterFilter.java:26) (RestServletUtilsUpdaterFilter.java:40) (DelegatingPluginFilter.java:78) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:70) (ContextFilter.java:25) (DelegatingPluginFilter.java:78) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:70) at com.atlassian.servicedesk.internal.web.RedirectExternalCustomerToPortalFilter.doFilter(RedirectExternalCustomerToPortalFilter.scala:18) <+4> (AbstractHttpFilter.java:31) (DelegatingPluginFilter.java:78) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:70) at com.atlassian.mywork.client.filter.ServingRequestsFilter.doFilter(ServingRequestsFilter.java:37) <+3> (DelegatingPluginFilter.java:78) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:70) at com.atlassian.plugins.cors.CorsFilter.doFilter(CorsFilter.java:65) <+3> (DelegatingPluginFilter.java:78) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:70) at com.atlassian.prettyurls.filter.PrettyUrlsSiteMeshFixupFilter.doFilter(PrettyUrlsSiteMeshFixupFilter.java:36) <+3> (DelegatingPluginFilter.java:78) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:70) at com.atlassian.prettyurls.filter.PrettyUrlsDispatcherFilter.doFilter(PrettyUrlsDispatcherFilter.java:60) <+3> (DelegatingPluginFilter.java:78) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:70) at com.atlassian.prettyurls.filter.PrettyUrlsSiteMeshFilter.doFilter(PrettyUrlsSiteMeshFilter.java:92) <+3> (DelegatingPluginFilter.java:78) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:70) at com.atlassian.prettyurls.filter.PrettyUrlsMatcherFilter.doFilter(PrettyUrlsMatcherFilter.java:56) <+3> (DelegatingPluginFilter.java:78) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:70) at com.atlassian.labs.botkiller.BotKillerFilter.doFilter(BotKillerFilter.java:36) <+18> (DelegatingPluginFilter.java:78) (IteratingFilterChain.java:42) (ServletFilterModuleContainerFilter.java:77) (ServletFilterModuleContainerFilter.java:63) (ApplicationFilterChain.java:241) (ApplicationFilterChain.java:208) (AccessLogFilter.java:103) (AccessLogFilter.java:87) (ApplicationFilterChain.java:241) (ApplicationFilterChain.java:208) (XsrfTokenAdditionRequestFilter.java:54) (ApplicationFilterChain.java:241) (ApplicationFilterChain.java:208) (ChainedFilterStepRunner.java:87) (ApplicationFilterChain.java:241) (ApplicationFilterChain.java:208) (IteratingFilterChain.java:46) (DelegatingPluginFilter.java:70) at com.atlassian.prettyurls.filter.PrettyUrlsCombinedMatchDispatcherFilter.doFilter(PrettyUrlsCombinedMatchDispatcherFilter.java:61) <+22> (DelegatingPluginFilter.java:78) (IteratingFilterChain.java:42) (ServletFilterModuleContainerFilter.java:77) (ServletFilterModuleContainerFilter.java:63) (ApplicationFilterChain.java:241) (ApplicationFilterChain.java:208) (SecurityFilter.java:239) (ApplicationFilterChain.java:241) (ApplicationFilterChain.java:208) (TrustedApplicationsFilter.java:100) (ApplicationFilterChain.java:241) (ApplicationFilterChain.java:208) (BaseLoginFilter.java:172) (JiraLoginFilter.java:70) (ApplicationFilterChain.java:241) (ApplicationFilterChain.java:208) (IteratingFilterChain.java:46) (DelegatingPluginFilter.java:70) (OAuthFilter.java:69) (DelegatingPluginFilter.java:78) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:70) at com.atlassian.plugins.rest.module.servlet.RestSeraphFilter.doFilter(RestSeraphFilter.java:40) <+3> (DelegatingPluginFilter.java:78) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:70) at com.atlassian.prettyurls.filter.PrettyUrlsCombinedMatchDispatcherFilter.doFilter(PrettyUrlsCombinedMatchDispatcherFilter.java:61) <+9> (DelegatingPluginFilter.java:78) (IteratingFilterChain.java:42) (ServletFilterModuleContainerFilter.java:77) (ServletFilterModuleContainerFilter.java:63) (ApplicationFilterChain.java:241) (ApplicationFilterChain.java:208) (AbstractJohnsonFilter.java:71) (ApplicationFilterChain.java:241) (ApplicationFilterChain.java:208) at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176) at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145) at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92) <+10> (UrlRewriteFilter.java:394) (ApplicationFilterChain.java:241) (ApplicationFilterChain.java:208) (GzipFilter.java:82) (GzipFilter.java:59) (JiraGzipFilter.java:55) (ApplicationFilterChain.java:241) (ApplicationFilterChain.java:208) (IteratingFilterChain.java:46) (DelegatingPluginFilter.java:70) at com.atlassian.analytics.client.filter.JiraAnalyticsFilter.doFilter(JiraAnalyticsFilter.java:41) <+4> (AbstractHttpFilter.java:31) (DelegatingPluginFilter.java:78) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:70) at com.atlassian.prettyurls.filter.PrettyUrlsCombinedMatchDispatcherFilter.doFilter(PrettyUrlsCombinedMatchDispatcherFilter.java:61) <+40> (DelegatingPluginFilter.java:78) (IteratingFilterChain.java:42) (ServletFilterModuleContainerFilter.java:77) (ServletFilterModuleContainerFilter.java:63) (ApplicationFilterChain.java:241) (ApplicationFilterChain.java:208) (ChainedFilterStepRunner.java:87) (ApplicationFilterChain.java:241) (ApplicationFilterChain.java:208) (AbstractCachingFilter.java:33) (AbstractHttpFilter.java:31) (ApplicationFilterChain.java:241) (ApplicationFilterChain.java:208) (AbstractEncodingFilter.java:41) (AbstractHttpFilter.java:31) (PathMatchingEncodingFilter.java:45) (AbstractHttpFilter.java:31) (ApplicationFilterChain.java:241) (ApplicationFilterChain.java:208) (JiraStartupChecklistFilter.java:79) (ApplicationFilterChain.java:241) (ApplicationFilterChain.java:208) (MultipartBoundaryCheckFilter.java:41) (ApplicationFilterChain.java:241) (ApplicationFilterChain.java:208) (ChainedFilterStepRunner.java:87) (JiraFirstFilter.java:60) (ApplicationFilterChain.java:241) (ApplicationFilterChain.java:208) (StandardWrapperValve.java:220) (StandardContextValve.java:122) (AuthenticatorBase.java:501) (StandardHostValve.java:171) (ErrorReportValve.java:103) (StandardEngineValve.java:116) (AccessLogValve.java:950) (CoyoteAdapter.java:408) (AjpProcessor.java:190) (AbstractProtocol.java:611) (JIoEndpoint.java:314) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Unknown Source) Caused by: java.sql.SQLException: Incorrect syntax near '-'. at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:368) at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2820) at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2258) at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:632) at net.sourceforge.jtds.jdbc.MSCursorResultSet.processOutput(MSCursorResultSet.java:943) at net.sourceforge.jtds.jdbc.MSCursorResultSet.<init>(MSCursorResultSet.java:154) at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:424) at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatement.java:778) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96) at net.java.ao.EntityManager.find(EntityManager.java:752) at net.java.ao.EntityManager.find(EntityManager.java:682) at com.atlassian.activeobjects.internal.EntityManagedActiveObjects.find(EntityManagedActiveObjects.java:175) ... 242 more {noformat}

    Atlassian JIRA | 2 years ago | Daniel Wagner
    java.sql.SQLException: Incorrect syntax near '-'.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    h3. Summary DBPC configuration {{pool-prepared-statements}} set to true leads to Statement Leak, In case of Oracle DB it will be 'ORA-01000: maximum open cursors exceeded' h3. Steps to Reproduce # Configure {{pool-prepared-statements}} to true # Wait h3. Expected Results No pool exception. h3. Actual Results The below exception is thrown in the atlassian-jira.log file: {noformat} ... java.sql.SQLException: ORA-01000: maximum open cursors exceeded at com.atlassian.activeobjects.internal.EntityManagedActiveObjects.find(EntityManagedActiveObjects.java:179) at com.atlassian.activeobjects.osgi.DelegatingActiveObjects.find(DelegatingActiveObjects.java:93) <+2> (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) ... {noformat} h3. Notes DBCP bug: [DBCP-372|https://issues.apache.org/jira/browse/DBCP-372], fixed in 1.5/2.x, JIRA uses 1.3/1.4 Note from: https://commons.apache.org/proper/commons-dbcp/configuration.html NOTE - Make sure your connection has some resources left for the other statements. Pooling PreparedStatements may keep their cursors open in the database, causing a connection to run out of cursors, especially if maxOpenPreparedStatements is left at the default (unlimited) and an application opens a large number of different PreparedStatements per connection. To avoid this problem, maxOpenPreparedStatements should be set to a value less than the maximum number of cursors that can be open on a Connection. h3.Workaround Remove {{pool-prepared-statements}} option (set to false)

    Atlassian JIRA | 1 year ago | Andriy Yakovlev [Atlassian]
    java.sql.SQLException: ORA-01000: maximum open cursors exceeded
  6. 0

    When I select an existing user during agent creation an SQL Exception is thrown by the Active Objects library, see attached screenshot. In the atlassian-jira.log file I found the following information: {noformat} 2014-10-17 11:40:40,452 ajp-bio-8009-exec-1 ERROR WAGNERDA 700x1062x1 1oe094s 10.20.24.4 /rest/servicedesk/1/servicedesk/admin/agent/promote [common.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service: There was a SQL exception thrown by the Active Objects library: Database: - name:Microsoft SQL Server - version:10.50.4033 - minor version:50 - major version:10 Driver: - name:jTDS Type 4 JDBC Driver for MS SQL Server and Sybase - version:1.2.4 java.sql.SQLException: Incorrect syntax near '-'. com.atlassian.activeobjects.internal.ActiveObjectsSqlException: There was a SQL exception thrown by the Active Objects library: Database: - name:Microsoft SQL Server - version:10.50.4033 - minor version:50 - major version:10 Driver: - name:jTDS Type 4 JDBC Driver for MS SQL Server and Sybase - version:1.2.4 java.sql.SQLException: Incorrect syntax near '-'. at com.atlassian.activeobjects.internal.EntityManagedActiveObjects.find(EntityManagedActiveObjects.java:179) at com.atlassian.activeobjects.osgi.DelegatingActiveObjects.find(DelegatingActiveObjects.java:93) <+2> at java.lang.reflect.Method.invoke(Unknown Source) 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.$Proxy3799.find(Unknown Source) at com.atlassian.activeobjects.scala.TypedActiveObjects.find(TypedActiveObjects.scala:13) at com.atlassian.servicedesk.internal.feature.servicedesk.ServiceDeskStore.getServiceDesks(ServiceDeskStore.scala:123) at com.atlassian.servicedesk.internal.feature.servicedesk.ServiceDeskStore.getServiceDeskWithLimit(ServiceDeskStore.scala:37) at com.atlassian.servicedesk.internal.feature.servicedesk.ServiceDeskManager.getMoreServiceDesks$1(ServiceDeskManager.scala:188) at com.atlassian.servicedesk.internal.feature.servicedesk.ServiceDeskManager.getServiceDesksLimited(ServiceDeskManager.scala:196) at com.atlassian.servicedesk.internal.feature.servicedesk.ServiceDeskService.getServiceDesksVisibleAsAgent(ServiceDeskService.scala:61) at com.atlassian.servicedesk.internal.feature.servicedesk.ServiceDeskService.getAllServiceDeskVisibleAsAgent(ServiceDeskService.scala:66) at com.atlassian.servicedesk.internal.feature.usermanagement.ServiceDeskTeamManager.getServiceDeskProjectsViewableByUser$1(ServiceDeskTeamManager.scala:45) at com.atlassian.servicedesk.internal.feature.usermanagement.ServiceDeskTeamManager.sendInviteForExistingAllocation(ServiceDeskTeamManager.scala:50) at com.atlassian.servicedesk.internal.feature.usermanagement.ServiceDeskTeamService.sendInviteForExistingAllocation(ServiceDeskTeamService.scala:50) at com.atlassian.servicedesk.internal.rest.ServiceDeskAgentResource$$anonfun$4$$anonfun$apply$17$$anonfun$apply$18$$anonfun$apply$19$$anonfun$apply$20.apply(ServiceDeskAgentResource.scala:114) at com.atlassian.servicedesk.internal.rest.ServiceDeskAgentResource$$anonfun$4$$anonfun$apply$17$$anonfun$apply$18$$anonfun$apply$19$$anonfun$apply$20.apply(ServiceDeskAgentResource.scala:112) at scalaz.Validation$class.map(Validation.scala:114) at scalaz.Success.map(Validation.scala:347) at com.atlassian.servicedesk.internal.rest.ServiceDeskAgentResource$$anonfun$4$$anonfun$apply$17$$anonfun$apply$18$$anonfun$apply$19.apply(ServiceDeskAgentResource.scala:112) at com.atlassian.servicedesk.internal.rest.ServiceDeskAgentResource$$anonfun$4$$anonfun$apply$17$$anonfun$apply$18$$anonfun$apply$19.apply(ServiceDeskAgentResource.scala:111) at scalaz.Validation$class.flatMap(Validation.scala:141) at scalaz.Success.flatMap(Validation.scala:347) at com.atlassian.servicedesk.internal.rest.ServiceDeskAgentResource$$anonfun$4$$anonfun$apply$17$$anonfun$apply$18.apply(ServiceDeskAgentResource.scala:111) at com.atlassian.servicedesk.internal.rest.ServiceDeskAgentResource$$anonfun$4$$anonfun$apply$17$$anonfun$apply$18.apply(ServiceDeskAgentResource.scala:110) at scalaz.Validation$class.flatMap(Validation.scala:141) at scalaz.Success.flatMap(Validation.scala:347) at com.atlassian.servicedesk.internal.rest.ServiceDeskAgentResource$$anonfun$4$$anonfun$apply$17.apply(ServiceDeskAgentResource.scala:110) at com.atlassian.servicedesk.internal.rest.ServiceDeskAgentResource$$anonfun$4$$anonfun$apply$17.apply(ServiceDeskAgentResource.scala:109) at scalaz.Validation$class.flatMap(Validation.scala:141) at scalaz.Success.flatMap(Validation.scala:347) at com.atlassian.servicedesk.internal.rest.ServiceDeskAgentResource$$anonfun$4.apply(ServiceDeskAgentResource.scala:109) at com.atlassian.servicedesk.internal.rest.ServiceDeskAgentResource$$anonfun$4.apply(ServiceDeskAgentResource.scala:108) at scalaz.Validation$class.flatMap(Validation.scala:141) at scalaz.Success.flatMap(Validation.scala:347) at com.atlassian.servicedesk.internal.rest.ServiceDeskAgentResource.promoteUserToAgent(ServiceDeskAgentResource.scala:108) <+3> at java.lang.reflect.Method.invoke(Unknown Source) <+19> (DispatchProviderHelper.java:234) (DispatchProviderHelper.java:100) (DefaultMethodInvocation.java:61) (ExpandInterceptor.java:38) (DefaultMethodInvocation.java:61) (DispatchProviderHelper.java:132) (DispatchProviderHelper.java:230) (ResourceJavaMethodDispatcher.java:75) (HttpMethodRule.java:288) (RightHandPathRule.java:147) (ResourceClassRule.java:108) (RightHandPathRule.java:147) (RootResourceClassesRule.java:84) (WebApplicationImpl.java:1469) (WebApplicationImpl.java:1400) (WebApplicationImpl.java:1349) (WebApplicationImpl.java:1339) (WebComponent.java:416) (ServletContainer.java:537) at com.atlassian.plugins.rest.module.RestDelegatingServletFilter$JerseyOsgiServletContainer.doFilter(RestDelegatingServletFilter.java:178) <+1> (ServletContainer.java:795) at com.atlassian.plugins.rest.module.RestDelegatingServletFilter.doFilter(RestDelegatingServletFilter.java:73) <+16> (DelegatingPluginFilter.java:78) (IteratingFilterChain.java:42) (ServletFilterModuleContainerFilter.java:77) (ServletFilterModuleContainerFilter.java:63) (DelegatingPluginFilter.java:78) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:70) (RestServletUtilsUpdaterFilter.java:26) (RestServletUtilsUpdaterFilter.java:40) (DelegatingPluginFilter.java:78) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:70) (ContextFilter.java:25) (DelegatingPluginFilter.java:78) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:70) at com.atlassian.servicedesk.internal.web.RedirectExternalCustomerToPortalFilter.doFilter(RedirectExternalCustomerToPortalFilter.scala:18) <+4> (AbstractHttpFilter.java:31) (DelegatingPluginFilter.java:78) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:70) at com.atlassian.mywork.client.filter.ServingRequestsFilter.doFilter(ServingRequestsFilter.java:37) <+3> (DelegatingPluginFilter.java:78) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:70) at com.atlassian.plugins.cors.CorsFilter.doFilter(CorsFilter.java:65) <+3> (DelegatingPluginFilter.java:78) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:70) at com.atlassian.prettyurls.filter.PrettyUrlsSiteMeshFixupFilter.doFilter(PrettyUrlsSiteMeshFixupFilter.java:36) <+3> (DelegatingPluginFilter.java:78) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:70) at com.atlassian.prettyurls.filter.PrettyUrlsDispatcherFilter.doFilter(PrettyUrlsDispatcherFilter.java:60) <+3> (DelegatingPluginFilter.java:78) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:70) at com.atlassian.prettyurls.filter.PrettyUrlsSiteMeshFilter.doFilter(PrettyUrlsSiteMeshFilter.java:92) <+3> (DelegatingPluginFilter.java:78) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:70) at com.atlassian.prettyurls.filter.PrettyUrlsMatcherFilter.doFilter(PrettyUrlsMatcherFilter.java:56) <+3> (DelegatingPluginFilter.java:78) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:70) at com.atlassian.labs.botkiller.BotKillerFilter.doFilter(BotKillerFilter.java:36) <+18> (DelegatingPluginFilter.java:78) (IteratingFilterChain.java:42) (ServletFilterModuleContainerFilter.java:77) (ServletFilterModuleContainerFilter.java:63) (ApplicationFilterChain.java:241) (ApplicationFilterChain.java:208) (AccessLogFilter.java:103) (AccessLogFilter.java:87) (ApplicationFilterChain.java:241) (ApplicationFilterChain.java:208) (XsrfTokenAdditionRequestFilter.java:54) (ApplicationFilterChain.java:241) (ApplicationFilterChain.java:208) (ChainedFilterStepRunner.java:87) (ApplicationFilterChain.java:241) (ApplicationFilterChain.java:208) (IteratingFilterChain.java:46) (DelegatingPluginFilter.java:70) at com.atlassian.prettyurls.filter.PrettyUrlsCombinedMatchDispatcherFilter.doFilter(PrettyUrlsCombinedMatchDispatcherFilter.java:61) <+22> (DelegatingPluginFilter.java:78) (IteratingFilterChain.java:42) (ServletFilterModuleContainerFilter.java:77) (ServletFilterModuleContainerFilter.java:63) (ApplicationFilterChain.java:241) (ApplicationFilterChain.java:208) (SecurityFilter.java:239) (ApplicationFilterChain.java:241) (ApplicationFilterChain.java:208) (TrustedApplicationsFilter.java:100) (ApplicationFilterChain.java:241) (ApplicationFilterChain.java:208) (BaseLoginFilter.java:172) (JiraLoginFilter.java:70) (ApplicationFilterChain.java:241) (ApplicationFilterChain.java:208) (IteratingFilterChain.java:46) (DelegatingPluginFilter.java:70) (OAuthFilter.java:69) (DelegatingPluginFilter.java:78) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:70) at com.atlassian.plugins.rest.module.servlet.RestSeraphFilter.doFilter(RestSeraphFilter.java:40) <+3> (DelegatingPluginFilter.java:78) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:70) at com.atlassian.prettyurls.filter.PrettyUrlsCombinedMatchDispatcherFilter.doFilter(PrettyUrlsCombinedMatchDispatcherFilter.java:61) <+9> (DelegatingPluginFilter.java:78) (IteratingFilterChain.java:42) (ServletFilterModuleContainerFilter.java:77) (ServletFilterModuleContainerFilter.java:63) (ApplicationFilterChain.java:241) (ApplicationFilterChain.java:208) (AbstractJohnsonFilter.java:71) (ApplicationFilterChain.java:241) (ApplicationFilterChain.java:208) at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176) at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145) at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92) <+10> (UrlRewriteFilter.java:394) (ApplicationFilterChain.java:241) (ApplicationFilterChain.java:208) (GzipFilter.java:82) (GzipFilter.java:59) (JiraGzipFilter.java:55) (ApplicationFilterChain.java:241) (ApplicationFilterChain.java:208) (IteratingFilterChain.java:46) (DelegatingPluginFilter.java:70) at com.atlassian.analytics.client.filter.JiraAnalyticsFilter.doFilter(JiraAnalyticsFilter.java:41) <+4> (AbstractHttpFilter.java:31) (DelegatingPluginFilter.java:78) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:70) at com.atlassian.prettyurls.filter.PrettyUrlsCombinedMatchDispatcherFilter.doFilter(PrettyUrlsCombinedMatchDispatcherFilter.java:61) <+40> (DelegatingPluginFilter.java:78) (IteratingFilterChain.java:42) (ServletFilterModuleContainerFilter.java:77) (ServletFilterModuleContainerFilter.java:63) (ApplicationFilterChain.java:241) (ApplicationFilterChain.java:208) (ChainedFilterStepRunner.java:87) (ApplicationFilterChain.java:241) (ApplicationFilterChain.java:208) (AbstractCachingFilter.java:33) (AbstractHttpFilter.java:31) (ApplicationFilterChain.java:241) (ApplicationFilterChain.java:208) (AbstractEncodingFilter.java:41) (AbstractHttpFilter.java:31) (PathMatchingEncodingFilter.java:45) (AbstractHttpFilter.java:31) (ApplicationFilterChain.java:241) (ApplicationFilterChain.java:208) (JiraStartupChecklistFilter.java:79) (ApplicationFilterChain.java:241) (ApplicationFilterChain.java:208) (MultipartBoundaryCheckFilter.java:41) (ApplicationFilterChain.java:241) (ApplicationFilterChain.java:208) (ChainedFilterStepRunner.java:87) (JiraFirstFilter.java:60) (ApplicationFilterChain.java:241) (ApplicationFilterChain.java:208) (StandardWrapperValve.java:220) (StandardContextValve.java:122) (AuthenticatorBase.java:501) (StandardHostValve.java:171) (ErrorReportValve.java:103) (StandardEngineValve.java:116) (AccessLogValve.java:950) (CoyoteAdapter.java:408) (AjpProcessor.java:190) (AbstractProtocol.java:611) (JIoEndpoint.java:314) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Unknown Source) Caused by: java.sql.SQLException: Incorrect syntax near '-'. at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:368) at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2820) at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2258) at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:632) at net.sourceforge.jtds.jdbc.MSCursorResultSet.processOutput(MSCursorResultSet.java:943) at net.sourceforge.jtds.jdbc.MSCursorResultSet.<init>(MSCursorResultSet.java:154) at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:424) at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatement.java:778) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96) at net.java.ao.EntityManager.find(EntityManager.java:752) at net.java.ao.EntityManager.find(EntityManager.java:682) at com.atlassian.activeobjects.internal.EntityManagedActiveObjects.find(EntityManagedActiveObjects.java:175) ... 242 more {noformat}

    Atlassian JIRA | 2 years ago | Daniel Wagner
    java.sql.SQLException: Incorrect syntax near '-'.

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.sql.SQLException

      Parameter index out of range (51 > number of parameters, which is 50).

      at com.atlassian.activeobjects.internal.EntityManagedActiveObjects.find()
    2. com.atlassian.activeobjects
      EntityManagedActiveObjects.find
      1. com.atlassian.activeobjects.internal.EntityManagedActiveObjects.find(EntityManagedActiveObjects.java:179)
      1 frame