org.springframework.jdbc.BadSqlGrammarException: Hibernate operation: error performing findBySQL; bad SQL grammar []; nested exception is com.ibm.db2.jcc.am.mo: DB2 SQL Error: SQLCODE=-134, SQLSTATE=42907, SQLERRMC=VERSIONC9_0_, DRIVER=4.7.85 Caused by: com.ibm.db2.jcc.am.mo: DB2 SQL Error: SQLCODE=-134, SQLSTATE=42907, SQLERRMC=VERSIONC9_0_, DRIVER=4.7.85 ...

Atlassian JIRA | Wolfram Richter | 6 years ago
  1. 0

    For Oracle: {noformat} caused by: org.springframework.jdbc.BadSqlGrammarException: Hibernate operation: error performing findBySQL; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: ORA-00932: inconsistent datatypes: expected - got CLOB at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.translate(SQLStateSQLExceptionTranslator.java:107) caused by: java.sql.SQLSyntaxErrorException: ORA-00932: inconsistent datatypes: expected - got CLOB at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:440) {noformat} For DB2: {noformat} 2011-04-13 06:19:41,145 ERROR [http-8080-6] [atlassian.confluence.servlet.ConfluenceServletDispatcher] sendError Could not execute action -- url: /pages/dopurgetrashitem.action | userName: admin | referer: http://ec2-50-16-150-219.compute-1.amazonaws.com:8080/pages/purgetrashitem.action?key=ds&contentId=32815 org.springframework.jdbc.BadSqlGrammarException: Hibernate operation: error performing findBySQL; bad SQL grammar []; nested exception is com.ibm.db2.jcc.am.mo: DB2 SQL Error: SQLCODE=-134, SQLSTATE=42907, SQLERRMC=VERSIONC9_0_, DRIVER=4.7.85 Caused by: com.ibm.db2.jcc.am.mo: DB2 SQL Error: SQLCODE=-134, SQLSTATE=42907, SQLERRMC=VERSIONC9_0_, DRIVER=4.7.85 ... at com.atlassian.confluence.pages.persistence.dao.hibernate.HibernatePageDao$5.doInHibernate(HibernatePageDao.java:473) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:370) at org.springframework.orm.hibernate.HibernateTemplate.executeFind(HibernateTemplate.java:341) at com.atlassian.confluence.pages.persistence.dao.hibernate.HibernatePageDao.getDescendents(HibernatePageDao.java:462) at com.atlassian.confluence.pages.persistence.dao.hibernate.CachingPageDao.getDescendents(CachingPageDao.java:201) at com.atlassian.confluence.pages.DefaultPageManager.getDescendents(DefaultPageManager.java:167) ... {noformat} For SQL Server: {noformat} 2011-04-06 14:37:19,123 ERROR [http-8081-9] [atlassian.confluence.servlet.ConfluenceServletDispatcher] sendError Could not execute action url: /pages/movepage.action | userName: xxxxx | referer: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: error performing findBySQL; uncategorized SQLException for SQL []; SQL state [S1000]; error code [421]; The ntext data type cannot be selected as DISTINCT because it is not comparable.; nested exception is java.sql.SQLException: The ntext data type cannot be selected as DISTINCT because it is not comparable. Caused by: java.sql.SQLException: The ntext data type cannot be selected as DISTINCT because it is not comparable. {noformat} {panel:title=Workaround Available|borderStyle=solid|borderColor=#3C78B5| titleBGColor=#3C78B5| bgColor=#E7F4FA} To fix this problem in Confluence 3.5.1 or 3.5.2, use the [attached patch|^CONF-22164-patch-v1.zip] as follows: # Shut down Confluence. # Unzip the patch file, [^CONF-22164-patch-v1.zip] into the {{confluence/WEB-INF/classes/}} directory. This will create a deep nesting of subdirectories with the 7 patched class files in {{confluence/WEB-INF/classes/com/atlassian/confluence/pages/persistence/dao/hibernate/}}. # Start Confluence again. Please contact [Atlassian support|https://support.atlassian.com] if you have trouble applying the patch. *Do not under any circumstances change your database schema to fix this problem.* Doing so may break future upgrades of Confluence and will not be supported by Atlassian in the future. If you have already changed your database schema to work around this problem, we recommend rolling back that change and applying this patch instead. The patch is not be required in Confluence 3.5.3 or later, which will ship with this fix. Confluence 3.5 and earlier does not have this issue. {panel}

    Atlassian JIRA | 6 years ago | Wolfram Richter
    org.springframework.jdbc.BadSqlGrammarException: Hibernate operation: error performing findBySQL; bad SQL grammar []; nested exception is com.ibm.db2.jcc.am.mo: DB2 SQL Error: SQLCODE=-134, SQLSTATE=42907, SQLERRMC=VERSIONC9_0_, DRIVER=4.7.85 Caused by: com.ibm.db2.jcc.am.mo: DB2 SQL Error: SQLCODE=-134, SQLSTATE=42907, SQLERRMC=VERSIONC9_0_, DRIVER=4.7.85 ...
  2. 0

    To reproduce this issue: 1. Create more than 20 job executions in the job repository. 2. From spring batch admin web application, select Executions. 3. Click Next page. An error screen will show up. Root cause: The SQL generated by the Db2PagingQueryProvider (SqlWindowingPagingQueryProvider) is: SELECT E.JOB_EXECUTION_ID FROM ( SELECT E.JOB_EXECUTION_ID, ROW_NUMBER() OVER ( ORDER BY E.JOB_EXECUTION_ID DESC) AS ROW_NUMBER FROM SPSSAMPLE.BATCH_JOB_EXECUTION E, SPSSAMPLE.BATCH_JOB_INSTANCE I WHERE E.JOB_INSTANCE_ID=I.JOB_INSTANCE_ID) AS TMP_SUB WHERE TMP_SUB.ROW_NUMBER = 20 ORDER BY E.JOB_EXECUTION_ID DESC The sortKey for this paginate query is "E.JOB_EXECUTION_ID". And the SQL seems to have problem on the field name since the table alias is only applicable for the subquery instead of the outer main query. Correct SQL should be: SELECT TMP_SUB.JOB_EXECUTION_ID FROM ( SELECT E.JOB_EXECUTION_ID, ROW_NUMBER() OVER ( ORDER BY E.JOB_EXECUTION_ID DESC) AS ROW_NUMBER FROM SPSSAMPLE.BATCH_JOB_EXECUTION E, SPSSAMPLE.BATCH_JOB_INSTANCE I WHERE E.JOB_INSTANCE_ID=I.JOB_INSTANCE_ID) AS TMP_SUB WHERE TMP_SUB.ROW_NUMBER = 20 ORDER BY TMP_SUB.JOB_EXECUTION_ID DESC Attached stack trace for the exception: 17:55:05,750 DEBUG http-bio-8080-exec-7 support.SQLErrorCodesFactory:175 - SQL error codes for 'DB2/LINUXX8664' found 17:55:05,760 DEBUG http-bio-8080-exec-7 support.SQLErrorCodeSQLExceptionTranslator:403 - Translating SQLException with SQL state '42703', error code '-206', message [DB2 SQL Error: SQLCODE=-206, SQLSTATE=42703, SQLERRMC=E.JOB_EXECUTION_ID, DRIVER=4.13.80]; SQL was [SELECT E.JOB_EXECUTION_ID FROM ( SELECT E.JOB_EXECUTION_ID, ROW_NUMBER() OVER ( ORDER BY E.JOB_EXECUTION_ID DESC) AS ROW_NUMBER FROM SPSSAMPLE.BATCH_JOB_EXECUTION E, SPSSAMPLE.BATCH_JOB_INSTANCE I WHERE E.JOB_INSTANCE_ID=I.JOB_INSTANCE_ID) AS TMP_SUB WHERE TMP_SUB.ROW_NUMBER = 20 ORDER BY E.JOB_EXECUTION_ID DESC] for task [StatementCallback] Aug 27, 2013 5:55:05 PM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet [Batch Servlet] in context with path [/batchsampleweb] threw exception [Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [SELECT E.JOB_EXECUTION_ID FROM ( SELECT E.JOB_EXECUTION_ID, ROW_NUMBER() OVER ( ORDER BY E.JOB_EXECUTION_ID DESC) AS ROW_NUMBER FROM SPSSAMPLE.BATCH_JOB_EXECUTION E, SPSSAMPLE.BATCH_JOB_INSTANCE I WHERE E.JOB_INSTANCE_ID=I.JOB_INSTANCE_ID) AS TMP_SUB WHERE TMP_SUB.ROW_NUMBER = 20 ORDER BY E.JOB_EXECUTION_ID DESC]; nested exception is com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-206, SQLSTATE=42703, SQLERRMC=E.JOB_EXECUTION_ID, DRIVER=4.13.80] with root cause com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-206, SQLSTATE=42703, SQLERRMC=E.JOB_EXECUTION_ID, DRIVER=4.13.80 at com.ibm.db2.jcc.am.id.a(id.java:677) at com.ibm.db2.jcc.am.id.a(id.java:60) at com.ibm.db2.jcc.am.id.a(id.java:127) at com.ibm.db2.jcc.am.fo.c(fo.java:2653) at com.ibm.db2.jcc.am.fo.d(fo.java:2641) at com.ibm.db2.jcc.am.fo.a(fo.java:2090) at com.ibm.db2.jcc.t4.cb.h(cb.java:141) at com.ibm.db2.jcc.t4.cb.b(cb.java:41) at com.ibm.db2.jcc.t4.q.a(q.java:32) at com.ibm.db2.jcc.t4.sb.i(sb.java:135) at com.ibm.db2.jcc.am.fo.ib(fo.java:2059) at com.ibm.db2.jcc.am.fo.a(fo.java:3130) at com.ibm.db2.jcc.am.fo.a(fo.java:688) at com.ibm.db2.jcc.am.fo.executeQuery(fo.java:672) at org.apache.tomcat.dbcp.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:208) at org.apache.tomcat.dbcp.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:208) at org.springframework.jdbc.core.JdbcTemplate$1QueryStatementCallback.doInStatement(JdbcTemplate.java:441) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:396) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:456) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:464) at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:472) at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:477) at org.springframework.batch.admin.service.JdbcSearchableJobExecutionDao.getJobExecutions(JdbcSearchableJobExecutionDao.java:191) at org.springframework.batch.admin.service.SimpleJobService.listJobExecutions(SimpleJobService.java:234) at org.springframework.batch.admin.web.JobExecutionController.list(JobExecutionController.java:161) 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:601) at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:219) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:745) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:686) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:827) at javax.servlet.http.HttpServlet.service(HttpServlet.java:621) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812) at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.springframework.web.filter.ShallowEtagHeaderFilter.doFilterInternal(ShallowEtagHeaderFilter.java:73) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1008) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312) 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:722)

    Spring JIRA | 3 years ago | Miles Huang
    org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [SELECT E.JOB_EXECUTION_ID FROM ( SELECT E.JOB_EXECUTION_ID, ROW_NUMBER() OVER ( ORDER BY E.JOB_EXECUTION_ID DESC) AS ROW_NUMBER FROM SPSSAMPLE.BATCH_JOB_EXECUTION E, SPSSAMPLE.BATCH_JOB_INSTANCE I WHERE E.JOB_INSTANCE_ID=I.JOB_INSTANCE_ID) AS TMP_SUB WHERE TMP_SUB.ROW_NUMBER = 20 ORDER BY E.JOB_EXECUTION_ID DESC]; nested exception is com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-206, SQLSTATE=42703, SQLERRMC=E.JOB_EXECUTION_ID, DRIVER=4.13.80] with root cause com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-206, SQLSTATE=42703, SQLERRMC=E.JOB_EXECUTION_ID, DRIVER=4.13.80
  3. 0

    To reproduce this issue: 1. Create more than 20 job executions in the job repository. 2. From spring batch admin web application, select Executions. 3. Click Next page. An error screen will show up. Root cause: The SQL generated by the Db2PagingQueryProvider (SqlWindowingPagingQueryProvider) is: SELECT E.JOB_EXECUTION_ID FROM ( SELECT E.JOB_EXECUTION_ID, ROW_NUMBER() OVER ( ORDER BY E.JOB_EXECUTION_ID DESC) AS ROW_NUMBER FROM SPSSAMPLE.BATCH_JOB_EXECUTION E, SPSSAMPLE.BATCH_JOB_INSTANCE I WHERE E.JOB_INSTANCE_ID=I.JOB_INSTANCE_ID) AS TMP_SUB WHERE TMP_SUB.ROW_NUMBER = 20 ORDER BY E.JOB_EXECUTION_ID DESC The sortKey for this paginate query is "E.JOB_EXECUTION_ID". And the SQL seems to have problem on the field name since the table alias is only applicable for the subquery instead of the outer main query. Correct SQL should be: SELECT TMP_SUB.JOB_EXECUTION_ID FROM ( SELECT E.JOB_EXECUTION_ID, ROW_NUMBER() OVER ( ORDER BY E.JOB_EXECUTION_ID DESC) AS ROW_NUMBER FROM SPSSAMPLE.BATCH_JOB_EXECUTION E, SPSSAMPLE.BATCH_JOB_INSTANCE I WHERE E.JOB_INSTANCE_ID=I.JOB_INSTANCE_ID) AS TMP_SUB WHERE TMP_SUB.ROW_NUMBER = 20 ORDER BY TMP_SUB.JOB_EXECUTION_ID DESC Attached stack trace for the exception: 17:55:05,750 DEBUG http-bio-8080-exec-7 support.SQLErrorCodesFactory:175 - SQL error codes for 'DB2/LINUXX8664' found 17:55:05,760 DEBUG http-bio-8080-exec-7 support.SQLErrorCodeSQLExceptionTranslator:403 - Translating SQLException with SQL state '42703', error code '-206', message [DB2 SQL Error: SQLCODE=-206, SQLSTATE=42703, SQLERRMC=E.JOB_EXECUTION_ID, DRIVER=4.13.80]; SQL was [SELECT E.JOB_EXECUTION_ID FROM ( SELECT E.JOB_EXECUTION_ID, ROW_NUMBER() OVER ( ORDER BY E.JOB_EXECUTION_ID DESC) AS ROW_NUMBER FROM SPSSAMPLE.BATCH_JOB_EXECUTION E, SPSSAMPLE.BATCH_JOB_INSTANCE I WHERE E.JOB_INSTANCE_ID=I.JOB_INSTANCE_ID) AS TMP_SUB WHERE TMP_SUB.ROW_NUMBER = 20 ORDER BY E.JOB_EXECUTION_ID DESC] for task [StatementCallback] Aug 27, 2013 5:55:05 PM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet [Batch Servlet] in context with path [/batchsampleweb] threw exception [Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [SELECT E.JOB_EXECUTION_ID FROM ( SELECT E.JOB_EXECUTION_ID, ROW_NUMBER() OVER ( ORDER BY E.JOB_EXECUTION_ID DESC) AS ROW_NUMBER FROM SPSSAMPLE.BATCH_JOB_EXECUTION E, SPSSAMPLE.BATCH_JOB_INSTANCE I WHERE E.JOB_INSTANCE_ID=I.JOB_INSTANCE_ID) AS TMP_SUB WHERE TMP_SUB.ROW_NUMBER = 20 ORDER BY E.JOB_EXECUTION_ID DESC]; nested exception is com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-206, SQLSTATE=42703, SQLERRMC=E.JOB_EXECUTION_ID, DRIVER=4.13.80] with root cause com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-206, SQLSTATE=42703, SQLERRMC=E.JOB_EXECUTION_ID, DRIVER=4.13.80 at com.ibm.db2.jcc.am.id.a(id.java:677) at com.ibm.db2.jcc.am.id.a(id.java:60) at com.ibm.db2.jcc.am.id.a(id.java:127) at com.ibm.db2.jcc.am.fo.c(fo.java:2653) at com.ibm.db2.jcc.am.fo.d(fo.java:2641) at com.ibm.db2.jcc.am.fo.a(fo.java:2090) at com.ibm.db2.jcc.t4.cb.h(cb.java:141) at com.ibm.db2.jcc.t4.cb.b(cb.java:41) at com.ibm.db2.jcc.t4.q.a(q.java:32) at com.ibm.db2.jcc.t4.sb.i(sb.java:135) at com.ibm.db2.jcc.am.fo.ib(fo.java:2059) at com.ibm.db2.jcc.am.fo.a(fo.java:3130) at com.ibm.db2.jcc.am.fo.a(fo.java:688) at com.ibm.db2.jcc.am.fo.executeQuery(fo.java:672) at org.apache.tomcat.dbcp.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:208) at org.apache.tomcat.dbcp.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:208) at org.springframework.jdbc.core.JdbcTemplate$1QueryStatementCallback.doInStatement(JdbcTemplate.java:441) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:396) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:456) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:464) at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:472) at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:477) at org.springframework.batch.admin.service.JdbcSearchableJobExecutionDao.getJobExecutions(JdbcSearchableJobExecutionDao.java:191) at org.springframework.batch.admin.service.SimpleJobService.listJobExecutions(SimpleJobService.java:234) at org.springframework.batch.admin.web.JobExecutionController.list(JobExecutionController.java:161) 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:601) at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:219) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:745) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:686) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:827) at javax.servlet.http.HttpServlet.service(HttpServlet.java:621) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812) at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.springframework.web.filter.ShallowEtagHeaderFilter.doFilterInternal(ShallowEtagHeaderFilter.java:73) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1008) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312) 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:722)

    Spring JIRA | 3 years ago | Miles Huang
    org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [SELECT E.JOB_EXECUTION_ID FROM ( SELECT E.JOB_EXECUTION_ID, ROW_NUMBER() OVER ( ORDER BY E.JOB_EXECUTION_ID DESC) AS ROW_NUMBER FROM SPSSAMPLE.BATCH_JOB_EXECUTION E, SPSSAMPLE.BATCH_JOB_INSTANCE I WHERE E.JOB_INSTANCE_ID=I.JOB_INSTANCE_ID) AS TMP_SUB WHERE TMP_SUB.ROW_NUMBER = 20 ORDER BY E.JOB_EXECUTION_ID DESC]; nested exception is com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-206, SQLSTATE=42703, SQLERRMC=E.JOB_EXECUTION_ID, DRIVER=4.13.80] with root cause com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-206, SQLSTATE=42703, SQLERRMC=E.JOB_EXECUTION_ID, DRIVER=4.13.80
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    [CONF-22164] Many page operations: move, restricting, deleting, etc. fail with Oracle, DB2 or SQL Server - Atlassian JIRA

    atlassian.com | 1 year ago
    org.springframework.jdbc.BadSqlGrammarException: Hibernate operation: error performing findBySQL; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: ORA-00932: inconsistent datatypes: expected - got CLOB
  6. 0

    For Oracle: {noformat} caused by: org.springframework.jdbc.BadSqlGrammarException: Hibernate operation: error performing findBySQL; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: ORA-00932: inconsistent datatypes: expected - got CLOB at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.translate(SQLStateSQLExceptionTranslator.java:107) caused by: java.sql.SQLSyntaxErrorException: ORA-00932: inconsistent datatypes: expected - got CLOB at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:440) {noformat} For DB2: {noformat} 2011-04-13 06:19:41,145 ERROR [http-8080-6] [atlassian.confluence.servlet.ConfluenceServletDispatcher] sendError Could not execute action -- url: /pages/dopurgetrashitem.action | userName: admin | referer: http://ec2-50-16-150-219.compute-1.amazonaws.com:8080/pages/purgetrashitem.action?key=ds&contentId=32815 org.springframework.jdbc.BadSqlGrammarException: Hibernate operation: error performing findBySQL; bad SQL grammar []; nested exception is com.ibm.db2.jcc.am.mo: DB2 SQL Error: SQLCODE=-134, SQLSTATE=42907, SQLERRMC=VERSIONC9_0_, DRIVER=4.7.85 Caused by: com.ibm.db2.jcc.am.mo: DB2 SQL Error: SQLCODE=-134, SQLSTATE=42907, SQLERRMC=VERSIONC9_0_, DRIVER=4.7.85 ... at com.atlassian.confluence.pages.persistence.dao.hibernate.HibernatePageDao$5.doInHibernate(HibernatePageDao.java:473) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:370) at org.springframework.orm.hibernate.HibernateTemplate.executeFind(HibernateTemplate.java:341) at com.atlassian.confluence.pages.persistence.dao.hibernate.HibernatePageDao.getDescendents(HibernatePageDao.java:462) at com.atlassian.confluence.pages.persistence.dao.hibernate.CachingPageDao.getDescendents(CachingPageDao.java:201) at com.atlassian.confluence.pages.DefaultPageManager.getDescendents(DefaultPageManager.java:167) ... {noformat} For SQL Server: {noformat} 2011-04-06 14:37:19,123 ERROR [http-8081-9] [atlassian.confluence.servlet.ConfluenceServletDispatcher] sendError Could not execute action url: /pages/movepage.action | userName: xxxxx | referer: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: error performing findBySQL; uncategorized SQLException for SQL []; SQL state [S1000]; error code [421]; The ntext data type cannot be selected as DISTINCT because it is not comparable.; nested exception is java.sql.SQLException: The ntext data type cannot be selected as DISTINCT because it is not comparable. Caused by: java.sql.SQLException: The ntext data type cannot be selected as DISTINCT because it is not comparable. {noformat} {panel:title=Workaround Available|borderStyle=solid|borderColor=#3C78B5| titleBGColor=#3C78B5| bgColor=#E7F4FA} To fix this problem in Confluence 3.5.1 or 3.5.2, use the [attached patch|^CONF-22164-patch-v1.zip] as follows: # Shut down Confluence. # Unzip the patch file, [^CONF-22164-patch-v1.zip] into the {{confluence/WEB-INF/classes/}} directory. This will create a deep nesting of subdirectories with the 7 patched class files in {{confluence/WEB-INF/classes/com/atlassian/confluence/pages/persistence/dao/hibernate/}}. # Start Confluence again. Please contact [Atlassian support|https://support.atlassian.com] if you have trouble applying the patch. *Do not under any circumstances change your database schema to fix this problem.* Doing so may break future upgrades of Confluence and will not be supported by Atlassian in the future. If you have already changed your database schema to work around this problem, we recommend rolling back that change and applying this patch instead. The patch is not be required in Confluence 3.5.3 or later, which will ship with this fix. Confluence 3.5 and earlier does not have this issue. {panel}

    Atlassian JIRA | 6 years ago | Wolfram Richter
    org.springframework.jdbc.BadSqlGrammarException: Hibernate operation: error performing findBySQL; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: ORA-00932: inconsistent datatypes: expected - got CLOB

    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. org.springframework.jdbc.BadSqlGrammarException

      Hibernate operation: error performing findBySQL; bad SQL grammar []; nested exception is com.ibm.db2.jcc.am.mo: DB2 SQL Error: SQLCODE=-134, SQLSTATE=42907, SQLERRMC=VERSIONC9_0_, DRIVER=4.7.85 Caused by: com.ibm.db2.jcc.am.mo: DB2 SQL Error: SQLCODE=-134, SQLSTATE=42907, SQLERRMC=VERSIONC9_0_, DRIVER=4.7.85 ...

      at com.atlassian.confluence.pages.persistence.dao.hibernate.HibernatePageDao$5.doInHibernate()
    2. com.atlassian.confluence
      HibernatePageDao$5.doInHibernate
      1. com.atlassian.confluence.pages.persistence.dao.hibernate.HibernatePageDao$5.doInHibernate(HibernatePageDao.java:473)
      1 frame
    3. Hibernate
      HibernateTemplate.executeFind
      1. org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:370)
      2. org.springframework.orm.hibernate.HibernateTemplate.executeFind(HibernateTemplate.java:341)
      2 frames
    4. com.atlassian.confluence
      DefaultPageManager.getDescendents
      1. com.atlassian.confluence.pages.persistence.dao.hibernate.HibernatePageDao.getDescendents(HibernatePageDao.java:462)
      2. com.atlassian.confluence.pages.persistence.dao.hibernate.CachingPageDao.getDescendents(CachingPageDao.java:201)
      3. com.atlassian.confluence.pages.DefaultPageManager.getDescendents(DefaultPageManager.java:167)
      3 frames