java.lang.Error: SQLWarning chain holds value that is not a SQLWarning

Spring JIRA | D. R. Vanlandingham | 8 years ago
  1. 0

    When storing an Integer into the 'OBJECT_VAL BLOB' field on the 'EXECUTION_CONTEXT' table I receive the exception below, seemingly caused by a 'Data Type Mismatch' (Also See Below) for the field. Line 178 of the JdbcExecutionContextDao (lobCreator.setBlobAsBytes(ps, 5, SerializationUtils.serialize((Serializable) value));) can be changed to: byte[] b = SerializationUtils.serialize((Serializable) value ); lobCreator.setBlobAsBinaryStream( ps, 8, new ByteArrayInputStream( b ), b.length ); ... and the problem seems to be resolved, however I am not sure how this would work on other databases. It may be worthwhile to allow a flexibility of what LobHandler is used so that the user is not always forced into using the 'DefaultLobHandler'. It seems that Spring recommends using the 'OracleLobHandler' for Oracle specific environments and allowing this flexibility could essentially lead a way around the problem for us, i.e. creating a 'DB2LobHandler' where we could change the behavior of the 'setBlobAsBytes'. This seems to be a specific DB2 issue caused by trying to a 'ByteArray' into a Blob field where a Byte InputStream appears to store without issue. The 'SQLWarning' trace below seems to be a side effect of this warning, however it in turn throws an exception that causes our job to rollback. Log message: 2008-09-03 15:18:23,126 DEBUG [org.springframework.jdbc.core.JdbcTemplate] SQLWarning ignored: SQL state 'null', error code '0', message [Input data type mismatch, see chained exceptions; will retry execution using describe input information. Please change application to use an input data type that matches the database column type as required by JDBC semantics.] Which then creates this Exception: java.lang.Error: SQLWarning chain holds value that is not a SQLWarning at java.sql.SQLWarning.getNextWarning(SQLWarning.java:111) at org.springframework.jdbc.core.JdbcTemplate.handleWarnings(JdbcTemplate.java:1172) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:567) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:594) at TestBlobExceptionyUtil.testBlobHandler(TestExceptionDisplayUtil.java:67) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:615) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:76) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) Which has a root cause of: com.ibm.db2.jcc.c.SqlException: DB2 SQL error: SQLCODE: -301, SQLSTATE: 42895, SQLERRMC: 8

    Spring JIRA | 8 years ago | D. R. Vanlandingham
    java.lang.Error: SQLWarning chain holds value that is not a SQLWarning
  2. 0

    When storing an Integer into the 'OBJECT_VAL BLOB' field on the 'EXECUTION_CONTEXT' table I receive the exception below, seemingly caused by a 'Data Type Mismatch' (Also See Below) for the field. Line 178 of the JdbcExecutionContextDao (lobCreator.setBlobAsBytes(ps, 5, SerializationUtils.serialize((Serializable) value));) can be changed to: byte[] b = SerializationUtils.serialize((Serializable) value ); lobCreator.setBlobAsBinaryStream( ps, 8, new ByteArrayInputStream( b ), b.length ); ... and the problem seems to be resolved, however I am not sure how this would work on other databases. It may be worthwhile to allow a flexibility of what LobHandler is used so that the user is not always forced into using the 'DefaultLobHandler'. It seems that Spring recommends using the 'OracleLobHandler' for Oracle specific environments and allowing this flexibility could essentially lead a way around the problem for us, i.e. creating a 'DB2LobHandler' where we could change the behavior of the 'setBlobAsBytes'. This seems to be a specific DB2 issue caused by trying to a 'ByteArray' into a Blob field where a Byte InputStream appears to store without issue. The 'SQLWarning' trace below seems to be a side effect of this warning, however it in turn throws an exception that causes our job to rollback. Log message: 2008-09-03 15:18:23,126 DEBUG [org.springframework.jdbc.core.JdbcTemplate] SQLWarning ignored: SQL state 'null', error code '0', message [Input data type mismatch, see chained exceptions; will retry execution using describe input information. Please change application to use an input data type that matches the database column type as required by JDBC semantics.] Which then creates this Exception: java.lang.Error: SQLWarning chain holds value that is not a SQLWarning at java.sql.SQLWarning.getNextWarning(SQLWarning.java:111) at org.springframework.jdbc.core.JdbcTemplate.handleWarnings(JdbcTemplate.java:1172) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:567) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:594) at TestBlobExceptionyUtil.testBlobHandler(TestExceptionDisplayUtil.java:67) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:615) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:76) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) Which has a root cause of: com.ibm.db2.jcc.c.SqlException: DB2 SQL error: SQLCODE: -301, SQLSTATE: 42895, SQLERRMC: 8

    Spring JIRA | 8 years ago | D. R. Vanlandingham
    java.lang.Error: SQLWarning chain holds value that is not a SQLWarning
  3. 0

    JdbcTemplate : Issue with dynamically configurable query arguments

    Stack Overflow | 3 years ago | Vicky
    java.lang.Error: SQLWarning chain holds value that is not a SQLWarning
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    ServiceMix - User - Failed to convert property value to required type 'org.aopalliance.aop.Advice' for property 'advice'

    nabble.com | 8 months ago
    java.lang.Error: SQLWarning chain holds value that is not a SQLWarning
  6. 0

    [ServiceMix-users] Failed to convert property value to required type 'org.aopalliance.aop.Advice' for property 'advice' - Grokbase

    grokbase.com | 8 months ago
    java.lang.Error: SQLWarning chain holds value that is not a SQLWarning

    1 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. java.lang.Error

      SQLWarning chain holds value that is not a SQLWarning

      at java.sql.SQLWarning.getNextWarning()
    2. Java RT
      SQLWarning.getNextWarning
      1. java.sql.SQLWarning.getNextWarning(SQLWarning.java:111)
      1 frame
    3. Spring Framework
      JdbcTemplate.execute
      1. org.springframework.jdbc.core.JdbcTemplate.handleWarnings(JdbcTemplate.java:1172)
      2. org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:567)
      3. org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:594)
      3 frames
    4. Unknown
      TestBlobExceptionyUtil.testBlobHandler
      1. TestBlobExceptionyUtil.testBlobHandler(TestExceptionDisplayUtil.java:67)
      1 frame
    5. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:615)
      4 frames
    6. JUnit
      TestCase.runBare
      1. junit.framework.TestCase.runTest(TestCase.java:154)
      2. junit.framework.TestCase.runBare(TestCase.java:127)
      2 frames
    7. Spring TestContext
      ConditionalTestCase.runBare
      1. org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:76)
      1 frame
    8. JUnit
      TestSuite.run
      1. junit.framework.TestResult$1.protect(TestResult.java:106)
      2. junit.framework.TestResult.runProtected(TestResult.java:124)
      3. junit.framework.TestResult.run(TestResult.java:109)
      4. junit.framework.TestCase.run(TestCase.java:118)
      5. junit.framework.TestSuite.runTest(TestSuite.java:208)
      6. junit.framework.TestSuite.run(TestSuite.java:203)
      6 frames
    9. JUnit3 Runner
      RemoteTestRunner.main
      1. org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
      2. org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      3. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
      4. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
      5. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
      6. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
      6 frames