java.lang.IllegalArgumentException: Value 0 of type class com.datastax.driver.core.querybuilder.Utils$RawString does not correspond to any CQL3 type

DataStax JIRA | Olivier Michallat | 2 years ago
  1. 0

    Discovered via: http://stackoverflow.com/questions/31415250/datastax-java-driver-convert-scala-collections-to-java-error If you use a type in a collection that doesn't correspond with a CQL type found in TypeCodec.getDataTypeFor the error is raised for the collection's class instead of the enclosing types class. For example: {code:java} session.execute("create keyspace if not exists test WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };"); session.execute("create table if not exists test.tbl (k text PRIMARY KEY, v map<text, text>);"); Map<String, SettableFuture<Double>> map = new HashMap<String, SettableFuture<Double>>(); map.put("hello", SettableFuture.<Double>create()); session.execute("insert into test.tbl (k, v) values (?,?)", "hello", map); {code} yields an exception on HashMap instead of SettableFuture. {noformat} java.lang.IllegalArgumentException: Value 1 of type class java.util.HashMap does not correspond to any CQL3 type at com.datastax.driver.core.SimpleStatement.convert(SimpleStatement.java:102) at com.datastax.driver.core.SimpleStatement.getValues(SimpleStatement.java:120) at com.datastax.driver.core.SessionManager.makeRequestMessage(SessionManager.java:518) at com.datastax.driver.core.SessionManager.makeRequestMessage(SessionManager.java:478) at com.datastax.driver.core.SessionManager.executeAsync(SessionManager.java:98) at com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:55) at com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:47) {noformat} The same would happen for a set/list: {noformat} java.lang.IllegalArgumentException: Value 1 of type class java.util.HashSet does not correspond to any CQL3 type at com.datastax.driver.core.SimpleStatement.convert(SimpleStatement.java:102) at com.datastax.driver.core.SimpleStatement.getValues(SimpleStatement.java:120) at com.datastax.driver.core.SessionManager.makeRequestMessage(SessionManager.java:518) at com.datastax.driver.core.SessionManager.makeRequestMessage(SessionManager.java:478) at com.datastax.driver.core.SessionManager.executeAsync(SessionManager.java:98) at com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:55) at com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:47) {noformat} There is also some code duplication between SimpleStatement.convert and Utils.convert and the error occurs in both places (from a SimpleStatement or BuildStatement).

    DataStax JIRA | 1 year ago | Andy Tolbert
    java.lang.IllegalArgumentException: Value 1 of type class java.util.HashMap does not correspond to any CQL3 type
  2. Speed up your debug routine!

    Automated exception search integrated into your IDE

  3. 0

    Discovered via: http://stackoverflow.com/questions/31415250/datastax-java-driver-convert-scala-collections-to-java-error If you use a type in a collection that doesn't correspond with a CQL type found in TypeCodec.getDataTypeFor the error is raised for the collection's class instead of the enclosing types class. For example: {code:java} session.execute("create keyspace if not exists test WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };"); session.execute("create table if not exists test.tbl (k text PRIMARY KEY, v map<text, text>);"); Map<String, SettableFuture<Double>> map = new HashMap<String, SettableFuture<Double>>(); map.put("hello", SettableFuture.<Double>create()); session.execute("insert into test.tbl (k, v) values (?,?)", "hello", map); {code} yields an exception on HashMap instead of SettableFuture. {noformat} java.lang.IllegalArgumentException: Value 1 of type class java.util.HashMap does not correspond to any CQL3 type at com.datastax.driver.core.SimpleStatement.convert(SimpleStatement.java:102) at com.datastax.driver.core.SimpleStatement.getValues(SimpleStatement.java:120) at com.datastax.driver.core.SessionManager.makeRequestMessage(SessionManager.java:518) at com.datastax.driver.core.SessionManager.makeRequestMessage(SessionManager.java:478) at com.datastax.driver.core.SessionManager.executeAsync(SessionManager.java:98) at com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:55) at com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:47) {noformat} The same would happen for a set/list: {noformat} java.lang.IllegalArgumentException: Value 1 of type class java.util.HashSet does not correspond to any CQL3 type at com.datastax.driver.core.SimpleStatement.convert(SimpleStatement.java:102) at com.datastax.driver.core.SimpleStatement.getValues(SimpleStatement.java:120) at com.datastax.driver.core.SessionManager.makeRequestMessage(SessionManager.java:518) at com.datastax.driver.core.SessionManager.makeRequestMessage(SessionManager.java:478) at com.datastax.driver.core.SessionManager.executeAsync(SessionManager.java:98) at com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:55) at com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:47) {noformat} There is also some code duplication between SimpleStatement.convert and Utils.convert and the error occurs in both places (from a SimpleStatement or BuildStatement).

    DataStax JIRA | 1 year ago | Andy Tolbert
    java.lang.IllegalArgumentException: Value 1 of type class java.util.HashSet does not correspond to any CQL3 type
  4. 0

    Unable to parse the external xsd while creating BO in Oracle BPM 12.1.3.0.0

    Oracle Community | 2 years ago | Anshul
    java.lang.IllegalArgumentException: The provided typeRef does not correspond to a type

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.IllegalArgumentException

      Value 0 of type class com.datastax.driver.core.querybuilder.Utils$RawString does not correspond to any CQL3 type

      at com.datastax.driver.core.querybuilder.Utils.convert()
    2. DataStax Java Driver for Apache Cassandra - Core
      Select$Where.getValues
      1. com.datastax.driver.core.querybuilder.Utils.convert(Utils.java:83)
      2. com.datastax.driver.core.querybuilder.BuiltStatement.getValues(BuiltStatement.java:172)
      3. com.datastax.driver.core.querybuilder.BuiltStatement$ForwardingStatement.getValues(BuiltStatement.java:341)
      4. com.datastax.driver.core.querybuilder.Select$Where.getValues(Select.java:188)
      4 frames