title: Jersey 2.0 HashMap conversion to/from Json
body: <p>I've Json like this, that is provided by a webservice:</p>
  
  <pre><code>{   ... 
      "metadata": {
          "name": "test_server",
          "server_type": "test",
           ...
      },
       ...
  }
  </code></pre>
  
  <p>I'm using GLasshfish, Netbeans and Jersey framework to consume web resources from the WS.
  According to Jersey features, I use some Java classes that map the Json structure, in order to obtain the conversion in data structures using Jersey (and JAX-RS annotation). For the mentioned Json packet I've created this class:</p>
  
  <pre><code>public class Server 
      {
        ...
  
        private Map&lt;String, String&gt; metadata = new HashMap&lt;String, String&gt;();
        ...
        public Server(){}
      }
  </code></pre>
  
  <p>The mapping works all fine, except for the "metadata" attribute, that is structured like a random-lenght map, with a String as both key and value.
  After that conversion, the result is that:</p>
  
  <pre><code>{
      "metadata": {
          "entry":[]
      }
  }
  </code></pre>
  
  <p>I've some similar case, but no solution. It seems that Jersey 2.0 isn't able to convert a map stile Json attribute in the corresponding Java data structure Object (HashMap).
  There aren't no exception or errors on the server, but the printed json map is always containing "entry":[], and I don't know where it comes out from.
  With other object types or data types I've no problem (List, int, String... all works fine).
  Can anyone help me? Thanks for support!</p>