java.lang.NullPointerException: null
at net.sf.log4jdbc.sql.resultsetcollector.DefaultResultSetCollector.loadMetaDataIfNeeded
at net.sf.log4jdbc.sql.resultsetcollector.DefaultResultSetCollector.loadMetaDataIfNeeded
at net.sf.log4jdbc.sql.jdbcapi.ResultSetSpy.loadMetaDataIfNeeded
at net.sf.log4jdbc.sql.jdbcapi.ResultSetSpy.close
at org.skife.jdbi.v2.Cleanables$ResultSetCleanable.cleanup
at org.skife.jdbi.v2.BaseStatement$StatementCleaningCustomizer.cleanup
at org.skife.jdbi.v2.BaseStatement.cleanup
at org.skife.jdbi.v2.GeneratedKeys.first
at org.skife.jdbi.v2.sqlobject.ResultReturnThing$SingleValueResultReturnThing.result
at org.skife.jdbi.v2.sqlobject.UpdateHandler$1.value
at org.skife.jdbi.v2.sqlobject.UpdateHandler.invoke
at org.skife.jdbi.v2.sqlobject.SqlObject.invoke
at org.skife.jdbi.v2.sqlobject.SqlObject$3.intercept
I'm not entirely sure what triggered this issue in the first place, it seems like ResultSetMetaData#getTableName started returning null which caused the NPE. Guarding that block with a null check seems to fix the issue.
Please note that my IDE made other (unrelated) changes to the file due to inconsistent line breaks and trailing spaces. You can ignore that. Actual change is on line 174
We recently started seeing a
NullPointerException
inDefaultResultSetCollector#loadMetaDataIfNeeded
on this line:Here is the relevant stacktrace:
I'm not entirely sure what triggered this issue in the first place, it seems like
ResultSetMetaData#getTableName
started returningnull
which caused the NPE. Guarding that block with a null check seems to fix the issue.Please note that my IDE made other (unrelated) changes to the file due to inconsistent line breaks and trailing spaces. You can ignore that. Actual change is on line 174