java.lang.NullPointerException: null

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • When doing a query like: {code} QueryBuilder.select() .all() .from("table") .where(eq("foo", bar)) .and(eq("bar", baz)); {code} If the `baz` variable is null then the datastax client will return a null pointer exception and crash. {code} ERROR [2016-03-14 14:51:54,112] Exception in getting result of future ! java.lang.NullPointerException: null ! at com.datastax.driver.core.querybuilder.Utils.appendName(Utils.java:237) ! at com.datastax.driver.core.querybuilder.Select.buildQueryString(Select.java:72) ! at com.datastax.driver.core.querybuilder.BuiltStatement.maybeRebuildCache(BuiltStatement.java:172) ! at com.datastax.driver.core.querybuilder.BuiltStatement.getValues(BuiltStatement.java:268) ! at com.datastax.driver.core.querybuilder.BuiltStatement$ForwardingStatement.getValues(BuiltStatement.java:436) ! at com.datastax.driver.core.querybuilder.Select$Where.getValues(Select.java:185) ! at com.datastax.driver.core.SessionManager.makeRequestMessage(SessionManager.java:548) ! at com.datastax.driver.core.SessionManager.executeAsync(SessionManager.java:131) ! at com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:63) {code} Is this expected? I am currently transitioning from Cassandra 1.1 cluster using the Hector client to a Cassandra 3.0 cluster using the official datastax client. The hector client appeared to be able to handle when column values were null, it might have just been serializing them to empty strings I'm not sure. Is there a way to more easily handle this with the datastax client or do I need to check to make sure the column value is not null for each column before issuing the query?
    via by Andrew Jorgensen,
  • When doing a query like: {code} QueryBuilder.select() .all() .from("table") .where(eq("foo", bar)) .and(eq("bar", baz)); {code} If the `baz` variable is null then the datastax client will return a null pointer exception and crash. {code} ERROR [2016-03-14 14:51:54,112] Exception in getting result of future ! java.lang.NullPointerException: null ! at com.datastax.driver.core.querybuilder.Utils.appendName(Utils.java:237) ! at com.datastax.driver.core.querybuilder.Select.buildQueryString(Select.java:72) ! at com.datastax.driver.core.querybuilder.BuiltStatement.maybeRebuildCache(BuiltStatement.java:172) ! at com.datastax.driver.core.querybuilder.BuiltStatement.getValues(BuiltStatement.java:268) ! at com.datastax.driver.core.querybuilder.BuiltStatement$ForwardingStatement.getValues(BuiltStatement.java:436) ! at com.datastax.driver.core.querybuilder.Select$Where.getValues(Select.java:185) ! at com.datastax.driver.core.SessionManager.makeRequestMessage(SessionManager.java:548) ! at com.datastax.driver.core.SessionManager.executeAsync(SessionManager.java:131) ! at com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:63) {code} Is this expected? I am currently transitioning from Cassandra 1.1 cluster using the Hector client to a Cassandra 3.0 cluster using the official datastax client. The hector client appeared to be able to handle when column values were null, it might have just been serializing them to empty strings I'm not sure. Is there a way to more easily handle this with the datastax client or do I need to check to make sure the column value is not null for each column before issuing the query?
    via by Andrew Jorgensen,
    • java.lang.NullPointerException: null at com.datastax.driver.core.querybuilder.Utils.appendName(Utils.java:237) at com.datastax.driver.core.querybuilder.Select.buildQueryString(Select.java:72) at com.datastax.driver.core.querybuilder.BuiltStatement.maybeRebuildCache(BuiltStatement.java:172) at com.datastax.driver.core.querybuilder.BuiltStatement.getValues(BuiltStatement.java:268) at com.datastax.driver.core.querybuilder.BuiltStatement$ForwardingStatement.getValues(BuiltStatement.java:436) at com.datastax.driver.core.querybuilder.Select$Where.getValues(Select.java:185) at com.datastax.driver.core.SessionManager.makeRequestMessage(SessionManager.java:548) at com.datastax.driver.core.SessionManager.executeAsync(SessionManager.java:131) at com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:63)
    No Bugmate found.