From: rwelty at ltionline.com (Welty, Richard) Date: Mon, 14 May 2012 15:16:22 -0400 Subject: [Pljava-dev] null pointer exception in pl/java jdbc driver Message-ID: i'm having trouble chasing down what may be close to the last bug in my pl/java code, a null pointer when executing an update. are there restrictions on what i can do inside a function with this jdbc driver? at this point, the code has successfully done a select, found the rows it wants and issued an http request to a solr search engine; now it needs to delete the rows that triggered the successful update: the method: private static void removeUpdateRecords( Connection conn, String core, List ids){ String idString = idsToString( ids); try { Statement update = conn.createStatement(); String updateString = "DELETE FROM solr_index_event WHERE core = '" + core + "' AND id IN (" + idString + ")"; Logger.getLogger(SolrPush.class.getName()).log( Level.INFO, "delete sql: " + updateString); update.executeUpdate(updateString); } catch (SQLException ex) { Logger.getLogger(SolrPush.class.getName()).log(Level.SEVERE, "Failed to remove solr_index_event row, core: " + core + " ids: " + idString, ex); throw new IllegalStateException("Failed to remove solr_index_event row core: " + core + " ids: " + idString, ex); } } here is the logger output (i've verified i have both an update statement and a complete and correct seeming sql update statement -- and yes, com.example in the java package names is deliberate obfuscation my part). INFO: 14 May 12 19:00:37 com.example.solr.SolrPush delete sql: DELETE FROM solr_index_event WHERE core = 'components' AND id IN (1651, 1652) ERROR: 14 May 12 19:00:37 com.example.solr.SolrPush Exception in RetryPush org.postgresql.pljava.internal.ServerException: 14 May 12 19:00:37 com.example.solr.SolrPush SQL Exception in retryPush org.postgresql.pljava.internal.ServerException: 14 May 12 19:00:37 com.example.solr.SolrPush Failed to remove solr_index_event row, core: components ids: 1651, 1652 org.postgresql.pljava.internal.ServerException: java.lang.NullPointerException at org.postgresql.pljava.internal.ExecutionPlan._execute(Native Method) at org.postgresql.pljava.internal.ExecutionPlan.execute(ExecutionPlan.java:187) at org.postgresql.pljava.jdbc.SPIStatement.executePlan(SPIStatement.java:132) at org.postgresql.pljava.jdbc.SPIStatement.execute(SPIStatement.java:108) at org.postgresql.pljava.jdbc.SPIStatement.executeUpdate(SPIStatement.java:193) at com.example.solr.SolrPush.removeUpdateRecords(SolrPush.java:390) at com.example.solr.SolrPush.doUpdates(SolrPush.java:197) at com.example.solr.SolrPush.retryPush(SolrPush.java:144) at org.postgresql.pljava.internal.Backend._log(Native Method) at org.postgresql.pljava.internal.Backend.log(Backend.java:79) at org.postgresql.pljava.internal.ELogHandler.publish(ELogHandler.java:100) at java.util.logging.Logger.log(Logger.java:498) at java.util.logging.Logger.doLog(Logger.java:520) at java.util.logging.Logger.log(Logger.java:609) at com.example.solr.SolrPush.removeUpdateRecords(SolrPush.java:392) at com.example.solr.SolrPush.doUpdates(SolrPush.java:197) at com.example.solr.SolrPush.retryPush(SolrPush.java:144) at org.postgresql.pljava.internal.Backend._log(Native Method) at org.postgresql.pljava.internal.Backend.log(Backend.java:79) at org.postgresql.pljava.internal.ELogHandler.publish(ELogHandler.java:100) at java.util.logging.Logger.log(Logger.java:498) at java.util.logging.Logger.doLog(Logger.java:520) at java.util.logging.Logger.log(Logger.java:609) at com.example.solr.SolrPush.retryPush(SolrPush.java:170) gforge=# -------------- next part -------------- An HTML attachment was scrubbed... URL: