I am running a query from ibatis and I get this error: java.lang.reflect.UndeclaredThrowableException at $Proxy9.getVisibleSelectedIds(Unknown Source) at (...) ... 18 more Caused by: com.ibatis.dao.client.DaoException: Error executing query for list. Cause: com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred while applying a parameter map. --- Check the getVisibleSelectedTopicIds-InlineParameterMap. --- Check the results (failed to retrieve results). --- Cause: java.lang.NullPointerException Caused by: java.lang.NullPointerException Caused by: com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred while applying a parameter map. --- Check the getVisibleSelectedTopicIds-InlineParameterMap. --- Check the results (failed to retrieve results). --- Cause: java.lang.NullPointerException Caused by: java.lang.NullPointerException (...)
However, the logger output of the query in question is as follows: 11:41:56,523 DEBUG PreparedStatement:28 - {pstm-100138} PreparedStatement: select id from topics where id in ( ? , ? ) and id not in ( select topic_key from topic_eligibility where is_visible = false and sponsor_key in ( ? , ? ) ) order by patient_title 11:41:56,524 DEBUG PreparedStatement:29 - {pstm-100138} Parameters: [125, 126, 1, 2] 11:41:56,525 DEBUG PreparedStatement:30 - {pstm-100138} Types: [java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer] 11:41:56,530 DEBUG ResultSet:24 - {rset-100139} ResultSet (The funny spacing in the SQL query is due to it being in an xml file, and some of it comes from the <iterate> tag.) Anyway, if I take that query (from the logger output) and paste it into a database client, and replace the question marks with the parameters output by the logger above, the query runs and returns data, just as I expect it to. (The database is in exactly the same state). So why is it that I can run this query manually, but when run from IBATIS it doesn't return data? I have actually run into a couple of cases where iBATIS threw an error that turned out to be about something other than what it claimed. But in this case, it really does seem to be this query, because I have isolated it from everything else to verify that. Thanks....