JsonMappingException when serializing avro generated object to json
<p>I used avro-tools to generate java classes from avsc files, using:</p>

<pre><code>java.exe -jar avro-tools-1.7.7.jar compile -string schema myfile.avsc 
</code></pre>

<p>Then I tried to serialize such objects to json by ObjectMapper,
but always got a JsonMappingException saying "not an enum" or "not a union".
In my test I create the generated object using it's builder or constructor.
I got such exceptions for objects of different classes...</p>

<p>Sample Code:</p>

<pre><code>ObjectMapper serializer = new ObjectMapper(); // com.fasterxml.jackson.databind
serializer.register(new JtsModule()); // com.bedatadriven.jackson.datatype.jts
...
return serializer.writeValueAsBytes(avroConvertedObject); // =&gt; JsonMappingException
</code></pre>

<p>I also tried many configurations using: serializer.configure(...) but still failed.
<strong>Versions:</strong> Java 1.8, jackson-datatype-jts 2.3, 
jackson-core 2.6.5, jackson-databind 2.6.5, jackson-annotations 2.6.5</p>

<p>Any suggestions?
Thanks!</p>