title: JSONMappingException - cannot desierialize Java object
body: <p>I'm getting the following error when using an <code>ObjectMapper</code> to de-serialize an object:</p>
  
  <blockquote>
    <p>JSONMappingException Can not construct instance of
    org.springframework.data.Page, problem: abstract types can only be
    instantiated with additional type information.</p>
  </blockquote>
  
  <p>I am trying to serialize a JSON string into a Spring data object <code>org.springframework.data.Page</code> which represents a page of type <code>T</code>.</p>
  
  <p>The <code>User</code> class is a simple POJO with <code>first</code> and <code>last</code> name. The JSON string I am deserializing is:</p>
  
  <pre><code>{
      "content": [
          {
              "firstname": "John",
              "lastname": "Doe"
          },
          {
              "firstname": "Jane",
              "lastname": "Doe"
          }
      ],
      "size": 2,
      "number": 0,
      "sort": [
          {
              "direction": "DESC",
              "property": "timestamp",
              "ascending": false
          }
      ],
      "totalPages": 150,
      "numberOfElements": 100,
      "totalElements": 15000,
      "firstPage": true,
      "lastPage": false
  }
  </code></pre>
  
  <p>This causes the exception:</p>
  
  <pre><code>Page&lt;User&gt; userPage = (Page&lt;User&gt;) new ObjectMapper().mapToJavaObject(json, new TypeReference&lt;Page&lt;User&gt;&gt;(){};
  </code></pre>
  
  <p>Since <code>Page</code> is a Spring object I cannot modify it which I think makes this a bit different from the way I see this question asked elsewhere. Any thoughts?</p>