org.springframework.jdbc.BadSqlGrammarException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • Steps to reproduce: # Create a page that is publicly accessible in OnDemand. # Visit the page using a [supported mobile device|https://confluence.atlassian.com/display/DOC/Supported+Platforms] (without logging in). You will receive an error saying: {quote}Oops! Something went wrong. It's probably us, but it might be you. Check your network connection.{quote} The following error will be generated in the Confluence logs: {noformat} org.springframework.jdbc.BadSqlGrammarException: Hibernate operation: Could not execute query; bad SQL grammar []; nested exception is org.postgresql.util.PSQLException: ERROR: operator does not exist: character varying = bytea Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts. Position: 468 at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:97) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) at org.springframework.orm.hibernate.HibernateAccessor.convertJdbcAccessException(HibernateAccessor.java:364) at org.springframework.orm.hibernate.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:351) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:375) at org.springframework.orm.hibernate.HibernateTemplate.executeFind(HibernateTemplate.java:341) at com.atlassian.hibernate.HibernateObjectDao.findNamedQueryStringParams(HibernateObjectDao.java:364) at com.atlassian.hibernate.HibernateObjectDao.findNamedQueryStringParams(HibernateObjectDao.java:319) at com.atlassian.confluence.mail.notification.persistence.dao.hibernate.HibernateNotificationDao.findNotificationByUserAndPage(HibernateNotificationDao.java:80) at com.atlassian.confluence.mail.notification.DefaultNotificationManager.getNotificationByUserAndPage(DefaultNotificationManager.java:48) {noformat}
    via by Mike Knight,
  • Steps to reproduce: # Create a page that is publicly accessible in OnDemand. # Visit the page using a [supported mobile device|https://confluence.atlassian.com/display/DOC/Supported+Platforms] (without logging in). You will receive an error saying: {quote}Oops! Something went wrong. It's probably us, but it might be you. Check your network connection.{quote} The following error will be generated in the Confluence logs: {noformat} org.springframework.jdbc.BadSqlGrammarException: Hibernate operation: Could not execute query; bad SQL grammar []; nested exception is org.postgresql.util.PSQLException: ERROR: operator does not exist: character varying = bytea Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts. Position: 468 at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:97) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) at org.springframework.orm.hibernate.HibernateAccessor.convertJdbcAccessException(HibernateAccessor.java:364) at org.springframework.orm.hibernate.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:351) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:375) at org.springframework.orm.hibernate.HibernateTemplate.executeFind(HibernateTemplate.java:341) at com.atlassian.hibernate.HibernateObjectDao.findNamedQueryStringParams(HibernateObjectDao.java:364) at com.atlassian.hibernate.HibernateObjectDao.findNamedQueryStringParams(HibernateObjectDao.java:319) at com.atlassian.confluence.mail.notification.persistence.dao.hibernate.HibernateNotificationDao.findNotificationByUserAndPage(HibernateNotificationDao.java:80) at com.atlassian.confluence.mail.notification.DefaultNotificationManager.getNotificationByUserAndPage(DefaultNotificationManager.java:48) {noformat}
    via by Mike Knight,
  • Try to search by Department Name doesn't have a "Search" spy glass icon like other lookup pages and search on a departments gets following error... org.springframework.jdbc.BadSqlGrammarException: OJB operation; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'dept' in 'where clause' at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:97) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) at org.springmodules.orm.ojb.OjbAccessor.convertJdbcAccessException(OjbAccessor.java:107) at org.springmodules.orm.ojb.OjbAccessor.convertOjbAccessException(OjbAccessor.java:89) at org.springmodules.orm.ojb.PersistenceBrokerTemplate.execute(PersistenceBrokerTemplate.java:144) at org.springmodules.orm.ojb.PersistenceBrokerTemplate.getCount(PersistenceBrokerTemplate.java:217) at org.kuali.rice.kns.dao.impl.LookupDaoOjb.executeSearch(LookupDaoOjb.java:158) at org.kuali.rice.kns.dao.impl.LookupDaoOjb.findCollectionBySearchHelper(LookupDaoOjb.java:77) at org.kuali.rice.kns.dao.impl.LookupDaoOjb.findCollectionBySearchHelper(LookupDaoOjb.java:63) at org.kuali.rice.kns.dao.proxy.LookupDaoProxy.findCollectionBySearchHelper(LookupDaoProxy.java:117) at sun.reflect.GeneratedMethodAccessor628.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) ....
    via by Mindi Balmer,
  • org.springframework.jdbc.BadSqlGrammarException: OJB operation; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'A0.ALLOW_NEGATIVE_ACC_BALANCE' in 'field list' at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:97) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) at org.springmodules.orm.ojb.OjbAccessor.convertJdbcAccessException(OjbAccessor.java:107) at org.springmodules.orm.ojb.OjbAccessor.convertOjbAccessException(OjbAccessor.java:89) at org.springmodules.orm.ojb.PersistenceBrokerTemplate.execute(PersistenceBrokerTemplate.java:144) at org.springmodules.orm.ojb.PersistenceBrokerTemplate.executeFind(PersistenceBrokerTemplate.java:162) at org.springmodules.orm.ojb.PersistenceBrokerTemplate.getCollectionByQuery(PersistenceBrokerTemplate.java:193) at org.kuali.rice.kns.dao.impl.LookupDaoOjb.executeSearch(LookupDaoOjb.java:164) at org.kuali.rice.kns.dao.impl.LookupDaoOjb.findCollectionBySearchHelper(LookupDaoOjb.java:77) at org.kuali.rice.kns.dao.impl.LookupDaoOjb.findCollectionBySearchHelper(LookupDaoOjb.java:63) at org.kuali.rice.kns.dao.proxy.LookupDaoProxy.findCollectionBySearchHelper(LookupDaoProxy.java:117) at sun.reflect.GeneratedMethodAccessor461.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) 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) ...
    via by Mindi Balmer,
  • This past weekend I attempted to upgrade from 5.1.3 to 5.2.5. This upgrade failed when it failed to find a table name user_mapping table. {noformat} 2013-09-28 16:00:33,300 ERROR [TP-Processor3] [sf.hibernate.util.JDBCExceptionReporter] logExceptions Table 'confluence.user_mapping' doesn't exist 2013-09-28 16:00:33,303 ERROR [TP-Processor3] [sf.hibernate.util.JDBCExceptionReporter] logExceptions Table 'confluence.user_mapping' doesn't exist 2013-09-28 16:00:33,307 ERROR [TP-Processor3] [[Catalina].[localhost].[/confluence].[noop]] log Servlet.service() for servlet noop threw exception org.springframework.jdbc.BadSqlGrammarException: Hibernate operation: Could not execute query; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'confluence.user_mapping' doesn't exist at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:97) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) at org.springframework.orm.hibernate.HibernateAccessor.convertJdbcAccessException(HibernateAccessor.java:364) at org.springframework.orm.hibernate.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:351) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:375) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:337) at com.atlassian.confluence.user.persistence.dao.hibernate.HibernateConfluenceUserDao.findByUsername(HibernateConfluenceUserDao.java:79) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) {noformat} After a lot of banging my head on my desk I instead attempted to upgrade to 5.2.3 which succeeded. I infer from this that the 5.2.5 upgrade is missing the logic to create this necessary table, or that you can't upgrade to 5.2.5 directly and have to upgrade to 5.2.3 first. If it's the latter, this should be documented.
    via by Andre Bickford,
  • Try to search by Department Name doesn't have a "Search" spy glass icon like other lookup pages and search on a departments gets following error... org.springframework.jdbc.BadSqlGrammarException: OJB operation; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'dept' in 'where clause' at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:97) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) at org.springmodules.orm.ojb.OjbAccessor.convertJdbcAccessException(OjbAccessor.java:107) at org.springmodules.orm.ojb.OjbAccessor.convertOjbAccessException(OjbAccessor.java:89) at org.springmodules.orm.ojb.PersistenceBrokerTemplate.execute(PersistenceBrokerTemplate.java:144) at org.springmodules.orm.ojb.PersistenceBrokerTemplate.getCount(PersistenceBrokerTemplate.java:217) at org.kuali.rice.kns.dao.impl.LookupDaoOjb.executeSearch(LookupDaoOjb.java:158) at org.kuali.rice.kns.dao.impl.LookupDaoOjb.findCollectionBySearchHelper(LookupDaoOjb.java:77) at org.kuali.rice.kns.dao.impl.LookupDaoOjb.findCollectionBySearchHelper(LookupDaoOjb.java:63) at org.kuali.rice.kns.dao.proxy.LookupDaoProxy.findCollectionBySearchHelper(LookupDaoProxy.java:117) at sun.reflect.GeneratedMethodAccessor628.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) ....
    via by Mindi Balmer,
  • org.springframework.jdbc.BadSqlGrammarException: OJB operation; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'A0.ALLOW_NEGATIVE_ACC_BALANCE' in 'field list' at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:97) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) at org.springmodules.orm.ojb.OjbAccessor.convertJdbcAccessException(OjbAccessor.java:107) at org.springmodules.orm.ojb.OjbAccessor.convertOjbAccessException(OjbAccessor.java:89) at org.springmodules.orm.ojb.PersistenceBrokerTemplate.execute(PersistenceBrokerTemplate.java:144) at org.springmodules.orm.ojb.PersistenceBrokerTemplate.executeFind(PersistenceBrokerTemplate.java:162) at org.springmodules.orm.ojb.PersistenceBrokerTemplate.getCollectionByQuery(PersistenceBrokerTemplate.java:193) at org.kuali.rice.kns.dao.impl.LookupDaoOjb.executeSearch(LookupDaoOjb.java:164) at org.kuali.rice.kns.dao.impl.LookupDaoOjb.findCollectionBySearchHelper(LookupDaoOjb.java:77) at org.kuali.rice.kns.dao.impl.LookupDaoOjb.findCollectionBySearchHelper(LookupDaoOjb.java:63) at org.kuali.rice.kns.dao.proxy.LookupDaoProxy.findCollectionBySearchHelper(LookupDaoProxy.java:117) at sun.reflect.GeneratedMethodAccessor461.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) 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) ...
    via by Mindi Balmer,
  • This past weekend I attempted to upgrade from 5.1.3 to 5.2.5. This upgrade failed when it failed to find a table name user_mapping table. {noformat} 2013-09-28 16:00:33,300 ERROR [TP-Processor3] [sf.hibernate.util.JDBCExceptionReporter] logExceptions Table 'confluence.user_mapping' doesn't exist 2013-09-28 16:00:33,303 ERROR [TP-Processor3] [sf.hibernate.util.JDBCExceptionReporter] logExceptions Table 'confluence.user_mapping' doesn't exist 2013-09-28 16:00:33,307 ERROR [TP-Processor3] [[Catalina].[localhost].[/confluence].[noop]] log Servlet.service() for servlet noop threw exception org.springframework.jdbc.BadSqlGrammarException: Hibernate operation: Could not execute query; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'confluence.user_mapping' doesn't exist at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:97) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) at org.springframework.orm.hibernate.HibernateAccessor.convertJdbcAccessException(HibernateAccessor.java:364) at org.springframework.orm.hibernate.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:351) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:375) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:337) at com.atlassian.confluence.user.persistence.dao.hibernate.HibernateConfluenceUserDao.findByUsername(HibernateConfluenceUserDao.java:79) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) {noformat} After a lot of banging my head on my desk I instead attempted to upgrade to 5.2.3 which succeeded. I infer from this that the 5.2.5 upgrade is missing the logic to create this necessary table, or that you can't upgrade to 5.2.5 directly and have to upgrade to 5.2.3 first. If it's the latter, this should be documented.
    via by Andre Bickford,
  • Deployment error
    via by Félix Navarro Guirado,
    • org.springframework.jdbc.BadSqlGrammarException: Hibernate operation: Could not execute query; bad SQL grammar []; nested exception is org.postgresql.util.PSQLException: ERROR: operator does not exist: character varying = bytea Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts. Position: 468 at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:97) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) at org.springframework.orm.hibernate.HibernateAccessor.convertJdbcAccessException(HibernateAccessor.java:364) at org.springframework.orm.hibernate.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:351) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:375) at org.springframework.orm.hibernate.HibernateTemplate.executeFind(HibernateTemplate.java:341) at com.atlassian.hibernate.HibernateObjectDao.findNamedQueryStringParams(HibernateObjectDao.java:364) at com.atlassian.hibernate.HibernateObjectDao.findNamedQueryStringParams(HibernateObjectDao.java:319) at com.atlassian.confluence.mail.notification.persistence.dao.hibernate.HibernateNotificationDao.findNotificationByUserAndPage(HibernateNotificationDao.java:80) at com.atlassian.confluence.mail.notification.DefaultNotificationManager.getNotificationByUserAndPage(DefaultNotificationManager.java:48)

    Users with the same issue

    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,