java.sql.SQLException: Conversion not supported for type xxx.enums.Gender

Spring JIRA | cemo koc | 2 years ago
  1. 0

    I have updated our codebase to spring 4.1 and had some problems. I am working with MySQL 5.6 and latest driver (5.1.32) and JDK8. The block below from JdbcUtils is throwing an exception at line `return rs.getObject(index, requiredType);` {code} if (getObjectWithTypeAvailable) { try { return rs.getObject(index, requiredType); } catch (SQLFeatureNotSupportedException ex) { logger.debug("JDBC driver does not support JDBC 4.1 'getObject(int, Class)' method", ex); } catch (AbstractMethodError err) { logger.debug("JDBC driver does not implement JDBC 4.1 'getObject(int, Class)' method", err); } } // Fall back to getObject without type specification... return getResultSetValue(rs, index); {code} I have also evaluated last statement which is working as expected. {code} return getResultSetValue(rs, index); {code} Here is the details: {code} ERROR [2014-09-10 12:44:55,993] com.clovify.lyso.guava.OptionalExtractorFactory: guava extractor expcetion: ! java.sql.SQLException: Conversion not supported for type xxx.enums.Gender ! at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1094) ~[mysql-connector-java-5.1.31.jar:na] ! at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:997) ~[mysql-connector-java-5.1.31.jar:na] ! at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:983) ~[mysql-connector-java-5.1.31.jar:na] ! at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:928) ~[mysql-connector-java-5.1.31.jar:na] ! at com.mysql.jdbc.ResultSetImpl.getObject(ResultSetImpl.java:5121) ~[mysql-connector-java-5.1.31.jar:na] ! at com.mysql.jdbc.JDBC4ResultSet.getObject(JDBC4ResultSet.java:542) ~[mysql-connector-java-5.1.31.jar:na] ! at org.springframework.jdbc.support.JdbcUtils.getResultSetValue(JdbcUtils.java:197) ~[spring-jdbc-4.1.0.RELEASE.jar:4.1.0.RELEASE] ! at org.springframework.jdbc.core.BeanPropertyRowMapper.getColumnValue(BeanPropertyRowMapper.java:311) ~[spring-jdbc-4.1.0.RELEASE.jar:4.1.0.RELEASE] ! at org.springframework.jdbc.core.BeanPropertyRowMapper.mapRow(BeanPropertyRowMapper.java:249) ~[spring-jdbc-4.1.0.RELEASE.jar:4.1.0.RELEASE] ! at org.springframework.jdbc.core.RowMapperResultSetExtractor.extractData(RowMapperResultSetExtractor.java:93) ~[spring-jdbc-4.1.0.RELEASE.jar:4.1.0.RELEASE] ! at org.springframework.jdbc.core.RowMapperResultSetExtractor.extractData(RowMapperResultSetExtractor.java:60) ~[spring-jdbc-4.1.0.RELEASE.jar:4.1.0.RELEASE] ! at org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:705) ~[spring-jdbc-4.1.0.RELEASE.jar:4.1.0.RELEASE] ! at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:641) ~[spring-jdbc-4.1.0.RELEASE.jar:4.1.0.RELEASE] ! ... 69 common frames omitted ! Causing: org.springframework.dao.TransientDataAccessResourceException: PreparedStatementCallback; SQL [SELECT * FROM USER WHERE EMAIL = ?]; Conversion not supported for type xxx.enums.Gender; nested exception is java.sql.SQLException: Conversion not supported for type xxx.enums.Gender ! at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:108) ~[spring-jdbc-4.1.0.RELEASE.jar:4.1.0.RELEASE] ! at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73) ~[spring-jdbc-4.1.0.RELEASE.jar:4.1.0.RELEASE] ! at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81) ~[spring-jdbc-4.1.0.RELEASE.jar:4.1.0.RELEASE] ! at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81) ~[spring-jdbc-4.1.0.RELEASE.jar:4.1.0.RELEASE] ! at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:657) ~[spring-jdbc-4.1.0.RELEASE.jar:4.1.0.RELEASE] ! at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:692) ~[spring-jdbc-4.1.0.RELEASE.jar:4.1.0.RELEASE] ! at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:719) ~[spring-jdbc-4.1.0.RELEASE.jar:4.1.0.RELEASE] ! at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:769) ~[spring-jdbc-4.1.0.RELEASE.jar:4.1.0.RELEASE] ! at org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.queryForObject(NamedParameterJdbcTemplate.java:211) ~[spring-jdbc-4.1.0.RELEASE.jar:4.1.0.RELEASE] {code} Is there any information I can provide?

    Spring JIRA | 2 years ago | cemo koc
    java.sql.SQLException: Conversion not supported for type xxx.enums.Gender
  2. 0

    I have updated our codebase to spring 4.1 and had some problems. I am working with MySQL 5.6 and latest driver (5.1.32) and JDK8. The block below from JdbcUtils is throwing an exception at line `return rs.getObject(index, requiredType);` {code} if (getObjectWithTypeAvailable) { try { return rs.getObject(index, requiredType); } catch (SQLFeatureNotSupportedException ex) { logger.debug("JDBC driver does not support JDBC 4.1 'getObject(int, Class)' method", ex); } catch (AbstractMethodError err) { logger.debug("JDBC driver does not implement JDBC 4.1 'getObject(int, Class)' method", err); } } // Fall back to getObject without type specification... return getResultSetValue(rs, index); {code} I have also evaluated last statement which is working as expected. {code} return getResultSetValue(rs, index); {code} Here is the details: {code} ERROR [2014-09-10 12:44:55,993] com.clovify.lyso.guava.OptionalExtractorFactory: guava extractor expcetion: ! java.sql.SQLException: Conversion not supported for type xxx.enums.Gender ! at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1094) ~[mysql-connector-java-5.1.31.jar:na] ! at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:997) ~[mysql-connector-java-5.1.31.jar:na] ! at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:983) ~[mysql-connector-java-5.1.31.jar:na] ! at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:928) ~[mysql-connector-java-5.1.31.jar:na] ! at com.mysql.jdbc.ResultSetImpl.getObject(ResultSetImpl.java:5121) ~[mysql-connector-java-5.1.31.jar:na] ! at com.mysql.jdbc.JDBC4ResultSet.getObject(JDBC4ResultSet.java:542) ~[mysql-connector-java-5.1.31.jar:na] ! at org.springframework.jdbc.support.JdbcUtils.getResultSetValue(JdbcUtils.java:197) ~[spring-jdbc-4.1.0.RELEASE.jar:4.1.0.RELEASE] ! at org.springframework.jdbc.core.BeanPropertyRowMapper.getColumnValue(BeanPropertyRowMapper.java:311) ~[spring-jdbc-4.1.0.RELEASE.jar:4.1.0.RELEASE] ! at org.springframework.jdbc.core.BeanPropertyRowMapper.mapRow(BeanPropertyRowMapper.java:249) ~[spring-jdbc-4.1.0.RELEASE.jar:4.1.0.RELEASE] ! at org.springframework.jdbc.core.RowMapperResultSetExtractor.extractData(RowMapperResultSetExtractor.java:93) ~[spring-jdbc-4.1.0.RELEASE.jar:4.1.0.RELEASE] ! at org.springframework.jdbc.core.RowMapperResultSetExtractor.extractData(RowMapperResultSetExtractor.java:60) ~[spring-jdbc-4.1.0.RELEASE.jar:4.1.0.RELEASE] ! at org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:705) ~[spring-jdbc-4.1.0.RELEASE.jar:4.1.0.RELEASE] ! at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:641) ~[spring-jdbc-4.1.0.RELEASE.jar:4.1.0.RELEASE] ! ... 69 common frames omitted ! Causing: org.springframework.dao.TransientDataAccessResourceException: PreparedStatementCallback; SQL [SELECT * FROM USER WHERE EMAIL = ?]; Conversion not supported for type xxx.enums.Gender; nested exception is java.sql.SQLException: Conversion not supported for type xxx.enums.Gender ! at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:108) ~[spring-jdbc-4.1.0.RELEASE.jar:4.1.0.RELEASE] ! at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73) ~[spring-jdbc-4.1.0.RELEASE.jar:4.1.0.RELEASE] ! at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81) ~[spring-jdbc-4.1.0.RELEASE.jar:4.1.0.RELEASE] ! at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81) ~[spring-jdbc-4.1.0.RELEASE.jar:4.1.0.RELEASE] ! at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:657) ~[spring-jdbc-4.1.0.RELEASE.jar:4.1.0.RELEASE] ! at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:692) ~[spring-jdbc-4.1.0.RELEASE.jar:4.1.0.RELEASE] ! at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:719) ~[spring-jdbc-4.1.0.RELEASE.jar:4.1.0.RELEASE] ! at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:769) ~[spring-jdbc-4.1.0.RELEASE.jar:4.1.0.RELEASE] ! at org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.queryForObject(NamedParameterJdbcTemplate.java:211) ~[spring-jdbc-4.1.0.RELEASE.jar:4.1.0.RELEASE] {code} Is there any information I can provide?

    Spring JIRA | 2 years ago | cemo koc
    java.sql.SQLException: Conversion not supported for type xxx.enums.Gender
  3. 0

    After updating to 5.0 stable file icons are broken - Open Knowledge Management

    openkm.com | 11 months ago
    com.openkm.core.DatabaseException: could not insert: [com.openkm.dao.bean.MimeType]
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    I don't know if this is restricted to just the embedded DB or not, but for some reason there's conversion errors showing up from MSN contacts when stored in the db. 2007.11.03 15:48:50 org.jivesoftware.openfire.gateway.util.Log4JToOpenfireAppender.append(Log4JToOpenfireAppender.java:49) Avatar: SQL exception while inserting avatar: java.sql.SQLException: Type Conversion not supported at org.hsqldb.jdbc.Util.sqlException(Unknown Source) at org.hsqldb.jdbc.jdbcPreparedStatement.setParameter(Unknown Source) at org.hsqldb.jdbc.jdbcPreparedStatement.setString(Unknown Source) at org.jivesoftware.openfire.gateway.avatars.Avatar.insertIntoDb(Avatar.java:226) at org.jivesoftware.openfire.gateway.avatars.Avatar.<init>(Avatar.java:109) at org.jivesoftware.openfire.gateway.protocols.oscar.BasicFlapConnection$1.handleResponse(BasicFlapConnection.java:209) at net.kano.joscar.snac.SnacRequest.gotResponse(SnacRequest.java:344) at net.kano.joscar.snac.ClientSnacProcessor.continueHandling(ClientSnacProcessor.java:727) at net.kano.joscar.snac.AbstractSnacProcessor.processPacket(AbstractSnacProcessor.java:447) at net.kano.joscar.snac.AbstractSnacProcessor.access$100(AbstractSnacProcessor.java:134) at net.kano.joscar.snac.AbstractSnacProcessor$1.handlePacket(AbstractSnacProcessor.java:208) at net.kano.joscar.flap.AbstractFlapProcessor.processPacketSynchronously(AbstractFlapProcessor.java:231) at net.kano.joscar.flap.AsynchronousFlapProcessor$BackgroundPacketProcessor.tryProcessingPackets(AsynchronousFlapProcessor.java:75) at net.kano.joscar.flap.AsynchronousFlapProcessor$BackgroundPacketProcessor.run(AsynchronousFlapProcessor.java:63) at java.lang.Thread.run(Thread.java:595)

    Jive Software Open Source | 9 years ago | Daniel Henninger
    java.sql.SQLException: Type Conversion not supported
  6. 0

    PreparedStatement: setInt() does not work

    hsqldb | 1 decade ago | leo_forge
    java.sql.SQLException: Type Conversion not supported

    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

      Conversion not supported for type xxx.enums.Gender

      at com.mysql.jdbc.SQLError.createSQLException()
    2. MySQL jdbc
      JDBC4ResultSet.getObject
      1. com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1094)[mysql-connector-java-5.1.31.jar:na]
      2. com.mysql.jdbc.SQLError.createSQLException(SQLError.java:997)[mysql-connector-java-5.1.31.jar:na]
      3. com.mysql.jdbc.SQLError.createSQLException(SQLError.java:983)[mysql-connector-java-5.1.31.jar:na]
      4. com.mysql.jdbc.SQLError.createSQLException(SQLError.java:928)[mysql-connector-java-5.1.31.jar:na]
      5. com.mysql.jdbc.ResultSetImpl.getObject(ResultSetImpl.java:5121)[mysql-connector-java-5.1.31.jar:na]
      6. com.mysql.jdbc.JDBC4ResultSet.getObject(JDBC4ResultSet.java:542)[mysql-connector-java-5.1.31.jar:na]
      6 frames
    3. Spring Framework
      JdbcTemplate.execute
      1. org.springframework.jdbc.support.JdbcUtils.getResultSetValue(JdbcUtils.java:197)[spring-jdbc-4.1.0.RELEASE.jar:4.1.0.RELEASE]
      2. org.springframework.jdbc.core.BeanPropertyRowMapper.getColumnValue(BeanPropertyRowMapper.java:311)[spring-jdbc-4.1.0.RELEASE.jar:4.1.0.RELEASE]
      3. org.springframework.jdbc.core.BeanPropertyRowMapper.mapRow(BeanPropertyRowMapper.java:249)[spring-jdbc-4.1.0.RELEASE.jar:4.1.0.RELEASE]
      4. org.springframework.jdbc.core.RowMapperResultSetExtractor.extractData(RowMapperResultSetExtractor.java:93)[spring-jdbc-4.1.0.RELEASE.jar:4.1.0.RELEASE]
      5. org.springframework.jdbc.core.RowMapperResultSetExtractor.extractData(RowMapperResultSetExtractor.java:60)[spring-jdbc-4.1.0.RELEASE.jar:4.1.0.RELEASE]
      6. org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:705)[spring-jdbc-4.1.0.RELEASE.jar:4.1.0.RELEASE]
      7. org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:641)[spring-jdbc-4.1.0.RELEASE.jar:4.1.0.RELEASE]
      7 frames