java.lang.NullPointerException: null

DataStax JIRA | Andrew Jorgensen | 1 year ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    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?

    DataStax JIRA | 1 year ago | Andrew Jorgensen
    java.lang.NullPointerException: null
  2. 0

    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?

    DataStax JIRA | 1 year ago | Andrew Jorgensen
    java.lang.NullPointerException: null

    Root Cause Analysis

    1. java.lang.NullPointerException

      null

      at com.datastax.driver.core.querybuilder.Utils.appendName()
    2. DataStax Java Driver for Apache Cassandra - Core
      AbstractSession.execute
      1. com.datastax.driver.core.querybuilder.Utils.appendName(Utils.java:237)
      2. com.datastax.driver.core.querybuilder.Select.buildQueryString(Select.java:72)
      3. com.datastax.driver.core.querybuilder.BuiltStatement.maybeRebuildCache(BuiltStatement.java:172)
      4. com.datastax.driver.core.querybuilder.BuiltStatement.getValues(BuiltStatement.java:268)
      5. com.datastax.driver.core.querybuilder.BuiltStatement$ForwardingStatement.getValues(BuiltStatement.java:436)
      6. com.datastax.driver.core.querybuilder.Select$Where.getValues(Select.java:185)
      7. com.datastax.driver.core.SessionManager.makeRequestMessage(SessionManager.java:548)
      8. com.datastax.driver.core.SessionManager.executeAsync(SessionManager.java:131)
      9. com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:63)
      9 frames