title: Datastax java driver, convert scala collections to java error
body: <p>I am trying to store a Scala Map (that I'm trying to convert to a java.util.Map) into cassandra 2.1.8.</p>
  
  <p>The data structure looks like this:</p>
  
  <pre><code>Map[String -&gt; Set[Tuple[String, String, String]]]
  </code></pre>
  
  <p>I created the table as follows:</p>
  
  <pre><code>CREATE TABLE mailing (emailaddr text PRIMARY KEY, totalmails bigint, emails map&lt;text, frozen&lt;set&lt;tuple&lt;text, text, text&gt;&gt;&gt;&gt;);
  </code></pre>
  
  <p>I first try to convert the Set's to java Set's:</p>
  
  <pre><code>def emailsToCassandra(addr: emailAddress, mail: MailContent, number: Int) = {
  println("Inserting emails into cassandra")
  
  mail.emails.foreach(result =&gt;
  
    setAsJavaSet(result._2)
  )
  </code></pre>
  
  <p>I then build the query and attempt to convert the Map to a java Map:</p>
  
  <pre><code>val query = QueryBuilder.insertInto("emails", "mailing")
                          .value("emailAddr", addr.toString())
                          .value("totalmails", number)
                          .value("emails", mapAsJavaMap(mail.emails))
  session.executeAsync(query)
  </code></pre>
  
  <p>I get back:</p>
  
  <pre><code>java.lang.IllegalArgumentException: Value 1 of type class scala.collection.convert.Wrappers$MapWrapper does not correspond to any CQL3 type
  </code></pre>
  
  <p>I also tried to do this:</p>
  
  <pre><code>val lol = mail.emails.asInstanceOf[java.util.Map[String, java.util.Set[Tuple3[String, String, String]]]]
  </code></pre>
  
  <p>Which didn't work</p>
  
  <p>Thank you in advance</p>