org.springframework.jdbc.IncorrectResultSetColumnCountException: Incorrect column count: expected 1, actual 8

Coderanch | Mary Cole | 6 years ago
  1. 0

    Error in executing Spring Query (Spring forum at Coderanch)

    coderanch.com | 7 months ago
    org.springframework.jdbc.IncorrectResultSetColumnCountException: Incorrect column count: expected 1, actual 8
  2. 0

    Error in executing Spring Query

    Coderanch | 6 years ago | Mary Cole
    org.springframework.jdbc.IncorrectResultSetColumnCountException: Incorrect column count: expected 1, actual 8
  3. 0

    the JdbcSearchableJobExecutionDao.getJobExecutions uses the SimpleJdbcTemplate queryForLong method and passes the query generated by an instance of PagingQueryProvider's generateJumpToItemQuery method. This is problematic when using the OraclePagingQueryProvider because generateJumpToItemQuery returns a resultset with two columns due to the use of Oracle's ROWNUM feature. As a result, the SingleColumnRowMapper that the SimpleJdbcTemplate uses to extract the Long blows up. The JdbcSearchableJobExecutionDao.getJobExecutions (and other paging methods) probably needs to be tweaked to stop using queryForLong and just use the first column retrieved. Alternatively, the OraclePagingQueryProvider.generateJumpToItemQuery could be mangled a bit to only return 1 column. The referenced spring forum post runs into this issue in the second to last entry, but it doesn't identify this as the root cause. Here's the stack trace: {noformat} 2010-10-07 13:39:17,016 ERROR [org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/].[Batch Servlet]] - Servlet.service() for servlet Batch Servlet threw exception org.springframework.jdbc.IncorrectResultSetColumnCountException: Incorrect column count: expected 1, actual 2 at org.springframework.jdbc.core.SingleColumnRowMapper.mapRow(SingleColumnRowMapper.java:87) at org.springframework.jdbc.core.RowMapperResultSetExtractor.extractData(RowMapperResultSetExtractor.java:92) at org.springframework.jdbc.core.RowMapperResultSetExtractor.extractData(RowMapperResultSetExtractor.java:1) at org.springframework.jdbc.core.JdbcTemplate$1QueryStatementCallback.doInStatement(JdbcTemplate.java:445) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:395) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:455) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:463) at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:471) at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:476) at org.springframework.jdbc.core.JdbcTemplate.queryForLong(JdbcTemplate.java:480) at org.springframework.jdbc.core.simple.SimpleJdbcTemplate.queryForLong(SimpleJdbcTemplate.java:127) at org.springframework.batch.admin.service.JdbcSearchableJobExecutionDao.getJobExecutions(JdbcSearchableJobExecutionDao.java:190) at org.springframework.batch.admin.service.SimpleJobService.listJobExecutions(SimpleJobService.java:220) at org.springframework.batch.admin.web.JobExecutionController.list(JobExecutionController.java:156) ...snip... {noformat}

    Spring JIRA | 6 years ago | Seth Weiner
    org.springframework.jdbc.IncorrectResultSetColumnCountException: Incorrect column count: expected 1, actual 2
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    org.springframework.jdbc.IncorrectResultSetColumnCoun Incorrect column count: expected 1, actual 7错误 - w1158384189的专栏 - 博客频道 - CSDN.NET

    csdn.net | 7 months ago
    org.springframework.jdbc.IncorrectResultSetColumnCountException: Incorrect column count: expected 1, actual 7
  6. 0

    spring-org.springframework.jdbc.IncorrectResultSetColumnCountException - 小码哥 - 博客园

    cnblogs.com | 7 months ago
    org.springframework.jdbc.IncorrectResultSetColumnCountException: Incorrect column count: expected 1, actual 4

    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.IncorrectResultSetColumnCountException

      Incorrect column count: expected 1, actual 8

      at org.springframework.jdbc.core.SingleColumnRowMapper.mapRow()
    2. Spring Framework
      NamedParameterJdbcTemplate.queryForObject
      1. org.springframework.jdbc.core.SingleColumnRowMapper.mapRow(SingleColumnRowMapper.java:87)
      2. org.springframework.jdbc.core.RowMapperResultSetExtractor.extractData(RowMapperResultSetExtractor.java:92)
      3. org.springframework.jdbc.core.RowMapperResultSetExtractor.extractData(RowMapperResultSetExtractor.java:1)
      4. org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:648)
      5. org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:586)
      6. org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:636)
      7. org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:661)
      8. org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:701)
      9. org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.queryForObject(NamedParameterJdbcTemplate.java:177)
      9 frames