java.sql.SQLException: No current row in the ResultSet.

Atlassian JIRA | David Currie [Atlassian] | 1 year ago
  1. 0

    h3. Summary On startup, JIRA attempts to perform a collation check. In certain scenarios this check will fail as the database name is incorrectly parsed from the JDBC URL. It can present with different errors depending upon the DBMS used. h3. Environment Reproduced with PostgreSQL 9.1 using the below JDBC URL: {code} jdbc:postgresql://localhost:5432/jira700?ssl=true {code} The below JDBC URL was reported as problematic however not reproduced: {code} jdbc:jtds:sqlserver://example.com:1433;databaseName=Jira {code} h3. Steps to Reproduce # Setup PostgreSQL to serve with SSL. #* Generate certificates. #* Edit {{postgresql.conf}} to use SSL, and optionally set the certificate location or put them in the {{<pg_install>/data}} directory. #* Restart PostgreSQL. #* Add {{?ssl=true}} to the JDBC url. # Start JIRA. h3. Expected Results It is able to correctly read the collation. h3. Actual Results The error below will appear: {noformat} **************************************************************************************************** The database collation could not be read. An unsupported collation could cause some functionality to not work **************************************************************************************************** {noformat} And will have a corresponding exception depending upon the DBMS used. JIRA will still start up. {noformat:title=PostgreSQL} 2015-10-21 22:06:10,507 localhost-startStop-1 INFO [c.a.j.appconsistency.db.CollationCheck] Exception when reading database collation org.postgresql.util.PSQLException: ResultSet not positioned properly, perhaps you need to call next. at org.postgresql.jdbc2.AbstractJdbc2ResultSet.checkResultSet(AbstractJdbc2ResultSet.java:2695) at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getString(AbstractJdbc2ResultSet.java:1872) at org.apache.commons.dbcp.DelegatingResultSet.getString(DelegatingResultSet.java:213) at org.apache.commons.dbcp.DelegatingResultSet.getString(DelegatingResultSet.java:213) at com.atlassian.jira.database.DatabaseCollationReader.findCollation(DatabaseCollationReader.java:46) at com.atlassian.jira.appconsistency.db.CollationCheck.isOk(CollationCheck.java:60) at com.atlassian.jira.startup.JiraDatabaseConfigChecklist.doStartupChecks(JiraDatabaseConfigChecklist.java:72) at com.atlassian.jira.startup.JiraDatabaseConfigChecklist.startupOK(JiraDatabaseConfigChecklist.java:60) at com.atlassian.jira.startup.DatabaseChecklistLauncher.start(DatabaseChecklistLauncher.java:46) at com.atlassian.jira.startup.DefaultJiraLauncher.lambda$postDbLaunch$174(DefaultJiraLauncher.java:123) at com.atlassian.jira.startup.DefaultJiraLauncher$$Lambda$9/1032956955.run(Unknown Source) at com.atlassian.jira.config.database.DatabaseConfigurationManagerImpl.doNowOrEnqueue(DatabaseConfigurationManagerImpl.java:356) at com.atlassian.jira.config.database.DatabaseConfigurationManagerImpl.doNowOrWhenDatabaseConfigured(DatabaseConfigurationManagerImpl.java:232) at com.atlassian.jira.startup.DefaultJiraLauncher.postDbLaunch(DefaultJiraLauncher.java:122) at com.atlassian.jira.startup.DefaultJiraLauncher.lambda$start$173(DefaultJiraLauncher.java:92) at com.atlassian.jira.startup.DefaultJiraLauncher$$Lambda$1/853477245.run(Unknown Source) at com.atlassian.jira.util.devspeed.JiraDevSpeedTimer.run(JiraDevSpeedTimer.java:34) at com.atlassian.jira.startup.DefaultJiraLauncher.start(DefaultJiraLauncher.java:90) at com.atlassian.jira.startup.LauncherContextListener.contextInitialized(LauncherContextListener.java:84) ... 5 filtered at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) {noformat} Or: {noformat:title=MS SQL Server} 2015-10-23 13:36:17,610 localhost-startStop-1 INFO [jira.appconsistency.db.CollationCheck] Exception when reading database collation java.sql.SQLException: No current row in the ResultSet. at net.sourceforge.jtds.jdbc.JtdsResultSet.getColumn(JtdsResultSet.java:285) at net.sourceforge.jtds.jdbc.JtdsResultSet.getString(JtdsResultSet.java:952) at org.apache.commons.dbcp.DelegatingResultSet.getString(DelegatingResultSet.java:213) at org.apache.commons.dbcp.DelegatingResultSet.getString(DelegatingResultSet.java:213) at com.atlassian.jira.database.DatabaseCollationReader.findCollation(DatabaseCollationReader.java:46) at com.atlassian.jira.appconsistency.db.CollationCheck.isOk(CollationCheck.java:60) at com.atlassian.jira.startup.JiraDatabaseConfigChecklist.doStartupChecks(JiraDatabaseConfigChecklist.java:72) at com.atlassian.jira.startup.JiraDatabaseConfigChecklist.startupOK(JiraDatabaseConfigChecklist.java:60) at com.atlassian.jira.startup.DatabaseChecklistLauncher.start(DatabaseChecklistLauncher.java:44) at com.atlassian.jira.startup.DefaultJiraLauncher$2.run(DefaultJiraLauncher.java:120) at com.atlassian.jira.config.database.DatabaseConfigurationManagerImpl.doNowOrEnqueue(DatabaseConfigurationManagerImpl.java:345) at com.atlassian.jira.config.database.DatabaseConfigurationManagerImpl.doNowOrWhenDatabaseConfigured(DatabaseConfigurationManagerImpl.java:221) at com.atlassian.jira.startup.DefaultJiraLauncher.postDbLaunch(DefaultJiraLauncher.java:115) at com.atlassian.jira.startup.DefaultJiraLauncher.access$100(DefaultJiraLauncher.java:33) at com.atlassian.jira.startup.DefaultJiraLauncher$1.run(DefaultJiraLauncher.java:86) at com.atlassian.jira.util.devspeed.JiraDevSpeedTimer.run(JiraDevSpeedTimer.java:34) at com.atlassian.jira.startup.DefaultJiraLauncher.start(DefaultJiraLauncher.java:81) at com.atlassian.jira.startup.LauncherContextListener.contextInitialized(LauncherContextListener.java:72) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5003) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5517) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652) at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:677) at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1912) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) {noformat} h3. Notes This exception will not prevent JIRA from starting up, and only occurs if the JDBC URL has additional data appended after it.

    Atlassian JIRA | 1 year ago | David Currie [Atlassian]
    java.sql.SQLException: No current row in the ResultSet.
  2. 0

    h3. Summary On startup, JIRA attempts to perform a collation check. In certain scenarios this check will fail as the database name is incorrectly parsed from the JDBC URL. It can present with different errors depending upon the DBMS used. h3. Environment Reproduced with PostgreSQL 9.1 using the below JDBC URL: {code} jdbc:postgresql://localhost:5432/jira700?ssl=true {code} The below JDBC URL was reported as problematic however not reproduced: {code} jdbc:jtds:sqlserver://example.com:1433;databaseName=Jira {code} h3. Steps to Reproduce # Setup PostgreSQL to serve with SSL. #* Generate certificates. #* Edit {{postgresql.conf}} to use SSL, and optionally set the certificate location or put them in the {{<pg_install>/data}} directory. #* Restart PostgreSQL. #* Add {{?ssl=true}} to the JDBC url. # Start JIRA. h3. Expected Results It is able to correctly read the collation. h3. Actual Results The error below will appear: {noformat} **************************************************************************************************** The database collation could not be read. An unsupported collation could cause some functionality to not work **************************************************************************************************** {noformat} And will have a corresponding exception depending upon the DBMS used. JIRA will still start up. {noformat:title=PostgreSQL} 2015-10-21 22:06:10,507 localhost-startStop-1 INFO [c.a.j.appconsistency.db.CollationCheck] Exception when reading database collation org.postgresql.util.PSQLException: ResultSet not positioned properly, perhaps you need to call next. at org.postgresql.jdbc2.AbstractJdbc2ResultSet.checkResultSet(AbstractJdbc2ResultSet.java:2695) at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getString(AbstractJdbc2ResultSet.java:1872) at org.apache.commons.dbcp.DelegatingResultSet.getString(DelegatingResultSet.java:213) at org.apache.commons.dbcp.DelegatingResultSet.getString(DelegatingResultSet.java:213) at com.atlassian.jira.database.DatabaseCollationReader.findCollation(DatabaseCollationReader.java:46) at com.atlassian.jira.appconsistency.db.CollationCheck.isOk(CollationCheck.java:60) at com.atlassian.jira.startup.JiraDatabaseConfigChecklist.doStartupChecks(JiraDatabaseConfigChecklist.java:72) at com.atlassian.jira.startup.JiraDatabaseConfigChecklist.startupOK(JiraDatabaseConfigChecklist.java:60) at com.atlassian.jira.startup.DatabaseChecklistLauncher.start(DatabaseChecklistLauncher.java:46) at com.atlassian.jira.startup.DefaultJiraLauncher.lambda$postDbLaunch$174(DefaultJiraLauncher.java:123) at com.atlassian.jira.startup.DefaultJiraLauncher$$Lambda$9/1032956955.run(Unknown Source) at com.atlassian.jira.config.database.DatabaseConfigurationManagerImpl.doNowOrEnqueue(DatabaseConfigurationManagerImpl.java:356) at com.atlassian.jira.config.database.DatabaseConfigurationManagerImpl.doNowOrWhenDatabaseConfigured(DatabaseConfigurationManagerImpl.java:232) at com.atlassian.jira.startup.DefaultJiraLauncher.postDbLaunch(DefaultJiraLauncher.java:122) at com.atlassian.jira.startup.DefaultJiraLauncher.lambda$start$173(DefaultJiraLauncher.java:92) at com.atlassian.jira.startup.DefaultJiraLauncher$$Lambda$1/853477245.run(Unknown Source) at com.atlassian.jira.util.devspeed.JiraDevSpeedTimer.run(JiraDevSpeedTimer.java:34) at com.atlassian.jira.startup.DefaultJiraLauncher.start(DefaultJiraLauncher.java:90) at com.atlassian.jira.startup.LauncherContextListener.contextInitialized(LauncherContextListener.java:84) ... 5 filtered at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) {noformat} Or: {noformat:title=MS SQL Server} 2015-10-23 13:36:17,610 localhost-startStop-1 INFO [jira.appconsistency.db.CollationCheck] Exception when reading database collation java.sql.SQLException: No current row in the ResultSet. at net.sourceforge.jtds.jdbc.JtdsResultSet.getColumn(JtdsResultSet.java:285) at net.sourceforge.jtds.jdbc.JtdsResultSet.getString(JtdsResultSet.java:952) at org.apache.commons.dbcp.DelegatingResultSet.getString(DelegatingResultSet.java:213) at org.apache.commons.dbcp.DelegatingResultSet.getString(DelegatingResultSet.java:213) at com.atlassian.jira.database.DatabaseCollationReader.findCollation(DatabaseCollationReader.java:46) at com.atlassian.jira.appconsistency.db.CollationCheck.isOk(CollationCheck.java:60) at com.atlassian.jira.startup.JiraDatabaseConfigChecklist.doStartupChecks(JiraDatabaseConfigChecklist.java:72) at com.atlassian.jira.startup.JiraDatabaseConfigChecklist.startupOK(JiraDatabaseConfigChecklist.java:60) at com.atlassian.jira.startup.DatabaseChecklistLauncher.start(DatabaseChecklistLauncher.java:44) at com.atlassian.jira.startup.DefaultJiraLauncher$2.run(DefaultJiraLauncher.java:120) at com.atlassian.jira.config.database.DatabaseConfigurationManagerImpl.doNowOrEnqueue(DatabaseConfigurationManagerImpl.java:345) at com.atlassian.jira.config.database.DatabaseConfigurationManagerImpl.doNowOrWhenDatabaseConfigured(DatabaseConfigurationManagerImpl.java:221) at com.atlassian.jira.startup.DefaultJiraLauncher.postDbLaunch(DefaultJiraLauncher.java:115) at com.atlassian.jira.startup.DefaultJiraLauncher.access$100(DefaultJiraLauncher.java:33) at com.atlassian.jira.startup.DefaultJiraLauncher$1.run(DefaultJiraLauncher.java:86) at com.atlassian.jira.util.devspeed.JiraDevSpeedTimer.run(JiraDevSpeedTimer.java:34) at com.atlassian.jira.startup.DefaultJiraLauncher.start(DefaultJiraLauncher.java:81) at com.atlassian.jira.startup.LauncherContextListener.contextInitialized(LauncherContextListener.java:72) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5003) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5517) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652) at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:677) at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1912) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) {noformat} h3. Notes This exception will not prevent JIRA from starting up, and only occurs if the JDBC URL has additional data appended after it.

    Atlassian JIRA | 1 year ago | David Currie [Atlassian]
    java.sql.SQLException: No current row in the ResultSet.
  3. 0

    Invalid column name Maedchen6_.

    jtds | 1 decade ago | wouterv
    java.sql.SQLException: Invalid column name Maedchen6\_.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Hibernate Community • View topic - Incorrect syntax near the keyword plan

    hibernate.org | 4 months ago
    javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute query
  6. 0

    Exception retrieving NTEXT column from MSSQL

    jtds | 1 decade ago | mquiazon
    java.sql.SQLException: The amount of data read from the stream is not = length.

    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

      No current row in the ResultSet.

      at net.sourceforge.jtds.jdbc.JtdsResultSet.getColumn()
    2. jTDS
      JtdsResultSet.getString
      1. net.sourceforge.jtds.jdbc.JtdsResultSet.getColumn(JtdsResultSet.java:285)
      2. net.sourceforge.jtds.jdbc.JtdsResultSet.getString(JtdsResultSet.java:952)
      2 frames
    3. Commons DBCP
      DelegatingResultSet.getString
      1. org.apache.commons.dbcp.DelegatingResultSet.getString(DelegatingResultSet.java:213)
      2. org.apache.commons.dbcp.DelegatingResultSet.getString(DelegatingResultSet.java:213)
      2 frames
    4. com.atlassian.jira
      LauncherContextListener.contextInitialized
      1. com.atlassian.jira.database.DatabaseCollationReader.findCollation(DatabaseCollationReader.java:46)
      2. com.atlassian.jira.appconsistency.db.CollationCheck.isOk(CollationCheck.java:60)
      3. com.atlassian.jira.startup.JiraDatabaseConfigChecklist.doStartupChecks(JiraDatabaseConfigChecklist.java:72)
      4. com.atlassian.jira.startup.JiraDatabaseConfigChecklist.startupOK(JiraDatabaseConfigChecklist.java:60)
      5. com.atlassian.jira.startup.DatabaseChecklistLauncher.start(DatabaseChecklistLauncher.java:44)
      6. com.atlassian.jira.startup.DefaultJiraLauncher$2.run(DefaultJiraLauncher.java:120)
      7. com.atlassian.jira.config.database.DatabaseConfigurationManagerImpl.doNowOrEnqueue(DatabaseConfigurationManagerImpl.java:345)
      8. com.atlassian.jira.config.database.DatabaseConfigurationManagerImpl.doNowOrWhenDatabaseConfigured(DatabaseConfigurationManagerImpl.java:221)
      9. com.atlassian.jira.startup.DefaultJiraLauncher.postDbLaunch(DefaultJiraLauncher.java:115)
      10. com.atlassian.jira.startup.DefaultJiraLauncher.access$100(DefaultJiraLauncher.java:33)
      11. com.atlassian.jira.startup.DefaultJiraLauncher$1.run(DefaultJiraLauncher.java:86)
      12. com.atlassian.jira.util.devspeed.JiraDevSpeedTimer.run(JiraDevSpeedTimer.java:34)
      13. com.atlassian.jira.startup.DefaultJiraLauncher.start(DefaultJiraLauncher.java:81)
      14. com.atlassian.jira.startup.LauncherContextListener.contextInitialized(LauncherContextListener.java:72)
      14 frames
    5. Glassfish Core
      HostConfig$DeployDescriptor.run
      1. org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5003)
      2. org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5517)
      3. org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
      4. org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
      5. org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
      6. org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
      7. org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:677)
      8. org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1912)
      8 frames
    6. Java RT
      Thread.run
      1. java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      2. java.util.concurrent.FutureTask.run(FutureTask.java:266)
      3. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      4. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      5. java.lang.Thread.run(Thread.java:745)
      5 frames