Jackson mixin not being called
<p>I have already posted something similar but I still trying to zero in on my problem.  </p>

<p>Thanks for bearing with me.</p>

<p>It would appear that jackson is not calling a mixin as it should and I can't tell why.</p>

<p>"Element" is an interface not a class.  It is normally instantiated with a static factory call as shown in the mixin (below).  The way I understand it, when jackson sees the interface: Element.class it should look up the mixin then execute the method that has the @JsonCreator annotation.  None of this is happening.  If it were, I would see output from the logger.  Instead, as one can see in the error message (way below), jackson is trying to treat my interface as a class and can't.  </p>

<p>Why isn't my mixin working?</p>

<p>Here's the mixin:</p>

<pre><code> public class ElementMixin {

      private static Logger log = LoggerFactory.getLogger(ElementMixin.class);

        @JsonCreator
        public static Element create() {
            log.error("Element==&gt;");
            return FhirFactory.eINSTANCE.createElement();
        }
       }
</code></pre>

<p>Here's how I register it with the mapper:</p>

<pre><code>    ObjectMapper mapper = new ObjectMapper();
    mapper.addMixIn(Element.class, ElementMixin.class);
</code></pre>

<p>Here's how I am running things:</p>

<pre><code>// Instantiate my interface, put some data in and serialize. 
Element ela = FhirFactory.eINSTANCE.createElement();
ela.setId("CBAEL");
StringWriter writer = new StringWriter();
mapper.writeValue(writer, ela);

// Now try to deserialize into a new instance.
StringReader reader = new StringReader(writer.toString());
Element elp = mapper.readValue(reader, Element.class);//Error thrown
assertNotNull(elp);
</code></pre>

<p>The error:</p>

<blockquote>
  <p>com.fasterxml.jackson.databind.JsonMappingException: Can not construct
  instance of fhir.Element, problem: abstract types either need to be
  mapped to concrete types, have custom deserializer, or be instantiated
  with additional type information  at [Source:
  java.io.StringReader@4fe533ff; line: 1, column: 1]    at
  com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:255)
    at
  com.fasterxml.jackson.databind.DeserializationContext.instantiationException(DeserializationContext.java:1007)
    at
  com.fasterxml.jackson.databind.deser.AbstractDeserializer.deserialize(AbstractDeserializer.java:150)
    at
  com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3807)
    at
  com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2844)
    at
  gov.nist.forecast.fhir.resources.IndexResourceTest.testParametersJSON(IndexResourceTest.java:173)</p>
</blockquote>