org.hibernate.exception.GenericJDBCException: Type SQL non valide: sqlKind = UNINITIALIZED

Spring JIRA | Laurent S. | 4 years ago
  1. 0

    Spring failed to parse SQL script when some lines are comments with tabs before comments markers. For example for the file : {noformat} -- My comment My SQL INSERT STATEMENT; {noformat} This will generate the following statement {noformat} -- My comment My SQL INSERT STATEMENT; {noformat} And throw the following exception on execution : {noformat} org.hibernate.exception.GenericJDBCException: Type SQL non valide: sqlKind = UNINITIALIZED at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:54) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:110) at org.hibernate.engine.jdbc.internal.proxy.AbstractStatementProxyHandler.continueInvocation(AbstractStatementProxyHandler.java:129) at org.hibernate.engine.jdbc.internal.proxy.AbstractProxyHandler.invoke(AbstractProxyHandler.java:81) at $Proxy53.executeUpdate(Unknown Source) at org.springframework.jdbc.core.JdbcTemplate$1UpdateStatementCallback.doInStatement(JdbcTemplate.java:509) at org.springframework.jdbc.core.JdbcTemplate$1UpdateStatementCallback.doInStatement(JdbcTemplate.java:1) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:396) at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:519) at org.springframework.jdbc.core.simple.SimpleJdbcTemplate.update(SimpleJdbcTemplate.java:252) at org.springframework.test.jdbc.SimpleJdbcTestUtils.executeSqlScript(SimpleJdbcTestUtils.java:150) at org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests.executeSqlScript(AbstractTransactionalJUnit4SpringContextTests.java:141) [...] {noformat} My guess for the fix would be to add trim on the following statement : {{JdbcTestUtils.java, readScript(LineNumberReader lineNumberReader, String commentPrefix)}}, Line 257: {code:java} if (StringUtils.hasText(currentStatement) && (commentPrefix != null && !currentStatement.trim().startsWith(commentPrefix))) { {code}

    Spring JIRA | 4 years ago | Laurent S.
    org.hibernate.exception.GenericJDBCException: Type SQL non valide: sqlKind = UNINITIALIZED
  2. 0

    Spring failed to parse SQL script when some lines are comments with tabs before comments markers. For example for the file : {noformat} -- My comment My SQL INSERT STATEMENT; {noformat} This will generate the following statement {noformat} -- My comment My SQL INSERT STATEMENT; {noformat} And throw the following exception on execution : {noformat} org.hibernate.exception.GenericJDBCException: Type SQL non valide: sqlKind = UNINITIALIZED at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:54) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:110) at org.hibernate.engine.jdbc.internal.proxy.AbstractStatementProxyHandler.continueInvocation(AbstractStatementProxyHandler.java:129) at org.hibernate.engine.jdbc.internal.proxy.AbstractProxyHandler.invoke(AbstractProxyHandler.java:81) at $Proxy53.executeUpdate(Unknown Source) at org.springframework.jdbc.core.JdbcTemplate$1UpdateStatementCallback.doInStatement(JdbcTemplate.java:509) at org.springframework.jdbc.core.JdbcTemplate$1UpdateStatementCallback.doInStatement(JdbcTemplate.java:1) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:396) at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:519) at org.springframework.jdbc.core.simple.SimpleJdbcTemplate.update(SimpleJdbcTemplate.java:252) at org.springframework.test.jdbc.SimpleJdbcTestUtils.executeSqlScript(SimpleJdbcTestUtils.java:150) at org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests.executeSqlScript(AbstractTransactionalJUnit4SpringContextTests.java:141) [...] {noformat} My guess for the fix would be to add trim on the following statement : {{JdbcTestUtils.java, readScript(LineNumberReader lineNumberReader, String commentPrefix)}}, Line 257: {code:java} if (StringUtils.hasText(currentStatement) && (commentPrefix != null && !currentStatement.trim().startsWith(commentPrefix))) { {code}

    Spring JIRA | 4 years ago | Laurent S.
    org.hibernate.exception.GenericJDBCException: Type SQL non valide: sqlKind = UNINITIALIZED
  3. 0

    Remote procedure call error

    GitHub | 2 years ago | milci199
    org.hibernate.exception.GenericJDBCException: General error: "java.lang.ArrayIndexOutOfBoundsException: 2048"; SQL statement:|select user0_.id as id4_, user0_.admin as admin4_, user0_.login as login4_, user0_.password as password4_, user0_.userSettings_id as userSett5_4_ from users user0_ where user0_.login=? [50000-180]
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    IndexOutOfBound searching in a @Lob field

    Stack Overflow | 4 years ago | caarlos0
    org.hibernate.exception.GenericJDBCException: java.lang.NullPointerException java.lang.NullPointerException
  6. 0

    How to save or retrieve an array column using Hibernate

    Stack Overflow | 3 years ago | user3316847
    org.hibernate.exception.GenericJDBCException: ERRO: transação atual foi interrompida, comandos ignorados até o fim do bloco de transação

    6 unregistered visitors
    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.hibernate.exception.GenericJDBCException

      Type SQL non valide: sqlKind = UNINITIALIZED

      at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert()
    2. Hibernate
      SqlExceptionHelper.convert
      1. org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:54)
      2. org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125)
      3. org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:110)
      3 frames
    3. org.hibernate.engine
      AbstractProxyHandler.invoke
      1. org.hibernate.engine.jdbc.internal.proxy.AbstractStatementProxyHandler.continueInvocation(AbstractStatementProxyHandler.java:129)
      2. org.hibernate.engine.jdbc.internal.proxy.AbstractProxyHandler.invoke(AbstractProxyHandler.java:81)
      2 frames
    4. Unknown
      $Proxy53.executeUpdate
      1. $Proxy53.executeUpdate(Unknown Source)
      1 frame
    5. Spring Framework
      SimpleJdbcTemplate.update
      1. org.springframework.jdbc.core.JdbcTemplate$1UpdateStatementCallback.doInStatement(JdbcTemplate.java:509)
      2. org.springframework.jdbc.core.JdbcTemplate$1UpdateStatementCallback.doInStatement(JdbcTemplate.java:1)
      3. org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:396)
      4. org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:519)
      5. org.springframework.jdbc.core.simple.SimpleJdbcTemplate.update(SimpleJdbcTemplate.java:252)
      5 frames
    6. Spring TestContext
      AbstractTransactionalJUnit4SpringContextTests.executeSqlScript
      1. org.springframework.test.jdbc.SimpleJdbcTestUtils.executeSqlScript(SimpleJdbcTestUtils.java:150)
      2. org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests.executeSqlScript(AbstractTransactionalJUnit4SpringContextTests.java:141)
      2 frames