[Pljava-dev] null pointer exception in pl/java jdbc driver

From: rwelty at ltionline(dot)com (Welty, Richard)
To:
Subject: [Pljava-dev] null pointer exception in pl/java jdbc driver
Date: 2012-05-14 19:16:22
Message-ID: C35FDD5FDF7E584991A6AAF8F1A8425F0226AD3A@ltischx01.lti.int
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pljava-dev

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<Integer> 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: <http://lists.pgfoundry.org/pipermail/pljava-dev/attachments/20120514/52575ee8/attachment.html>

Responses

Browse pljava-dev by date

  From Date Subject
Next Message Welty, Richard 2012-05-17 19:34:07 [Pljava-dev] null pointer exception in pl/java jdbc driver
Previous Message Welty, Richard 2012-05-14 15:09:04 [Pljava-dev] untrusted PL/Java?