title: json4s scala.MatchError (of class scala.Tuple2)
body: <p>I have a custom class, that I want to convert to JSON but I am getting a weird error found here:</p>
  
  <pre><code>Exception in thread "main" scala.MatchError: (23,com.xxx.dts.dq.common.utils.DQOpsStoreProfileStatus@5f275ae4) (of class scala.Tuple2)
  </code></pre>
  
  <p>Code Here:</p>
  
  <pre><code>implicit val formats = org.json4s.DefaultFormats
  val A = Serialization.write(resultsMap)
  println(A)
  </code></pre>
  
  <p>Now if I do a foreach:</p>
  
  <pre><code> resultsMap.foreach(x =&gt; println(Serialization.write(x)))
  </code></pre>
  
  <p>I get some results back but they do not look correct:</p>
  
  <pre><code>{"_1":23,"_2":{}}
  {"_1":32,"_2":{}}
  </code></pre>
  
  <p>The Tuples are missing their core information. I am assuming because the custom class we are using causing some sort of issues? Is there any way around it? </p>
  
  <p>If I were to pull the second element of the map and convert it to JSON it would look like this:</p>
  
  <pre><code>{"errorCode":null,"id":null,"fieldType":"STRING","fieldIndex":0,"datasetFieldName":"RECORD_ID","datasetFieldSum":0.0,"datasetFieldMin":0.0,"datasetFieldMax":0.0,"datasetFieldMean":0.0,"datasetFieldSigma":0.0,"datasetFieldNullCount":0.0,"datasetFieldObsCount":0.0,"datasetFieldKurtosis":0.0,"datasetFieldSkewness":0.0,"frequencyDistribution":"(D,4488)","runStatusId":null,"lakeHdfsPath":"/user/jvy234/20140817_011500_zoot_kohls_offer_init.dat"}
  </code></pre>
  
  <p>Also on a side note the class was written in java, if that may be the culprit? </p>
  
  <p>Full Stack Trace:</p>
  
  <pre><code>Exception in thread "main" scala.MatchError: (0,com.xxx.dts.dq.common.utils.DQOpsStoreProfileStatus@315a29f4) (of class scala.Tuple2)
      at org.json4s.Extraction$.internalDecomposeWithBuilder(Extraction.scala:132)
      at org.json4s.Extraction$.decomposeWithBuilder(Extraction.scala:67)
      at org.json4s.Extraction$.decompose(Extraction.scala:194)
      at org.json4s.jackson.Serialization$.write(Serialization.scala:22)
      at com.xxx.dts.toolset.jsonWrite$.jsonClob(jsonWrite.scala:16)
      at com.xxx.dts.dq.profiling.DQProfilingEngine.profile(DQProfilingEngine.scala:255)
      at com.xxx.dts.dq.profiling.Profiler$.main(DQProfilingEngine.scala:64)
      at com.xxx.dts.dq.profiling.Profiler.main(DQProfilingEngine.scala)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:569)
      at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:166)
      at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:189)
      at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:110)
      at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
  </code></pre>