title: unable to parse json string to a generic java object
body: <p>I am working on a jersey web services.
  <a href="https://stackoverflow.com/questions/19113280/jersey-rest-services-showing-exception-javax-ws-rs-webapplicationexception-java">like this</a> following is the json string i received at my jersey client </p>
  
  <pre><code>{"license":"12345","dimRequirement":[{"alternateId":"AlternateID","classificati‌​on":"1"}] }
  </code></pre>
  
  <p>but when i am parsing it gives error.I used jackson for parsing</p>
  
  <pre><code>    Unrecognized field "dimRequirement" (Class com.vxl.AppObject), not marked as ignorable
  at [Source: java.io.StringReader@7be6f06c; line: 1, column: 49] (through reference chain: com.vxl.appanalytix.AppObject["dimRequirement"])
      at org.codehaus.jackson.map.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:53)
      at org.codehaus.jackson.map.deser.StdDeserializationContext.unknownFieldException(StdDeserializationContext.java:244)
      at org.codehaus.jackson.map.deser.StdDeserializer.reportUnknownProperty(StdDeserializer.java:589)
      at org.codehaus.jackson.map.deser.StdDeserializer.handleUnknownProperty(StdDeserializer.java:575)
      at org.codehaus.jackson.map.deser.BeanDeserializer.handleUnknownProperty(BeanDeserializer.java:684)
      at org.codehaus.jackson.map.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:515)
      at org.codehaus.jackson.map.deser.BeanDeserializer.deserialize(BeanDeserializer.java:351)
      at org.codehaus.jackson.map.ObjectMapper._readMapAndClose(ObjectMapper.java:2131)
      at org.codehaus.jackson.map.ObjectMapper.readValue(ObjectMapper.java:1402)
      at com.vxl.CheckJersy.main(CheckJersy.java:56)
  </code></pre>
  
  <p>i tried by adding type Reference for parsing </p>
  
  <pre><code>new ObjectMapper().readValue(
                  output,new TypeReference&lt;AppObject&lt;DimRequirement&gt;&gt;() { } );
  </code></pre>
  
  <p><strong>generic class</strong></p>
  
  <pre><code>    @XmlRootElement
  @XmlSeeAlso({ DimRequirement.class})
      public class AppObject&lt;T&gt; implements Serializable {
  
          private List&lt;T&gt; list;
          private String license;
  
          public AppObject() {
              list = new ArrayList&lt;T&gt;();
  
          }
  
          public AppObject(List&lt;T&gt; list) {
              this.list = list;
          }
  
          @XmlAnyElement(lax = true)
          public List&lt;T&gt; getList() {
              return list;
          }
  
          public void setList(List&lt;T&gt; list) {
              this.list = list;
          }
  
          public String getLicense() {
              return license;
          }
  
          public void setLicense(String license) {
              this.license = license;
          }
  
      }
  </code></pre>
  
  <p><strong>services</strong>
  I want to use the same service for more than one POST request returning  <code>AppObject&lt;xxx&gt;,AppObject&lt;yyy&gt;</code></p>
  
  <pre><code>@POST
      @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
      @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
      @Path("/getreq")
      @Override
      public AppObject getAllByClientNIsCurrent(
              AppObject&lt;DimRequirement&gt; appObject) {
          List&lt;DimRequirement&gt; dimreqlist = dimRequirementDao
                  .getAllByClientNIsCurrent(appObject.getClientKey());
          AppObject&lt;DimRequirement&gt; appObject = new AppObject&lt;DimRequirement&gt;();
          appObject.setList(dimreqlist);
          return appObject;
      }
  </code></pre>