java.lang.IllegalArgumentException: Value 1 of type class java.util.HashMap does not correspond to any CQL3 type

DataStax JIRA | Andy Tolbert | 1 year 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. 0

    I ran into the following exception when trying to stress test the Newts integration with OpenNMS. In these tests, a single resource could contain as many as 3000 metrics. {code} Exception in thread "pool-10-thread-13" java.lang.IllegalArgumentException: Too many values for built statement, the maximum allowed is 65535 at com.datastax.driver.core.querybuilder.BuiltStatement.maybeRebuildCache(BuiltStatement.java:87) at com.datastax.driver.core.querybuilder.BuiltStatement.getValues(BuiltStatement.java:180) at com.datastax.driver.core.querybuilder.Batch.getValues(Batch.java:133) at com.datastax.driver.core.SessionManager.makeRequestMessage(SessionManager.java:513) at com.datastax.driver.core.SessionManager.makeRequestMessage(SessionManager.java:474) at com.datastax.driver.core.SessionManager.executeAsync(SessionManager.java:97) at com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:52) at org.opennms.newts.cassandra.CassandraSession.execute(CassandraSession.java:87) at org.opennms.newts.cassandra.search.CassandraIndexer.update(CassandraIndexer.java:96) at org.opennms.newts.cassandra.search.CassandraIndexerSampleProcessor.submit(CassandraIndexerSampleProcessor.java:45) at org.opennms.newts.api.SampleProcessorService$1.run(SampleProcessorService.java:76) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) {code}

    The OpenNMS Issue Tracker | 1 year ago | Jesse White
    java.lang.IllegalArgumentException: Too many values for built statement, the maximum allowed is 65535
  3. 0

    I ran into the following exception when trying to stress test the Newts integration with OpenNMS. In these tests, a single resource could contain as many as 3000 metrics. {code} Exception in thread "pool-10-thread-13" java.lang.IllegalArgumentException: Too many values for built statement, the maximum allowed is 65535 at com.datastax.driver.core.querybuilder.BuiltStatement.maybeRebuildCache(BuiltStatement.java:87) at com.datastax.driver.core.querybuilder.BuiltStatement.getValues(BuiltStatement.java:180) at com.datastax.driver.core.querybuilder.Batch.getValues(Batch.java:133) at com.datastax.driver.core.SessionManager.makeRequestMessage(SessionManager.java:513) at com.datastax.driver.core.SessionManager.makeRequestMessage(SessionManager.java:474) at com.datastax.driver.core.SessionManager.executeAsync(SessionManager.java:97) at com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:52) at org.opennms.newts.cassandra.CassandraSession.execute(CassandraSession.java:87) at org.opennms.newts.cassandra.search.CassandraIndexer.update(CassandraIndexer.java:96) at org.opennms.newts.cassandra.search.CassandraIndexerSampleProcessor.submit(CassandraIndexerSampleProcessor.java:45) at org.opennms.newts.api.SampleProcessorService$1.run(SampleProcessorService.java:76) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) {code}

    The OpenNMS Issue Tracker | 1 year ago | Jesse White
    java.lang.IllegalArgumentException: Too many values for built statement, the maximum allowed is 65535
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    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 1 of type class java.util.HashMap does not correspond to any CQL3 type

      at com.datastax.driver.core.SimpleStatement.convert()
    2. DataStax Java Driver for Apache Cassandra - Core
      AbstractSession.execute
      1. com.datastax.driver.core.SimpleStatement.convert(SimpleStatement.java:102)
      2. com.datastax.driver.core.SimpleStatement.getValues(SimpleStatement.java:120)
      3. com.datastax.driver.core.SessionManager.makeRequestMessage(SessionManager.java:518)
      4. com.datastax.driver.core.SessionManager.makeRequestMessage(SessionManager.java:478)
      5. com.datastax.driver.core.SessionManager.executeAsync(SessionManager.java:98)
      6. com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:55)
      7. com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:47)
      7 frames