title: HttpMediaTypeNotAcceptableException
body: <p>I am having problem with my jQuery function what I am trying to achieve is to populate data in a listbox </p>
  
  <p>The JavaScript function </p>
  
  <pre><code>function load() {
          $.getJSON('${findAdminGroupsURL}', {
              ajax : 'true'
          }, function(data) {
              var html = '&lt;option value=""&gt;Groups&lt;/option&gt;';
              var len = data.length;
              for ( var i = 0; i &lt; len; i++) {
                  html += '&lt;option value="' + data[i].name + '"&gt;' + data[i].name
                          + '&lt;/option&gt;';
              }
              html += '&lt;/option&gt;';
  
              $('#selection').html(html);
          });
      }
  </code></pre>
  
  <p>The server side is</p>
  
  <pre><code>@RequestMapping(value = "groups", method = RequestMethod.GET)
      public @ResponseBody
      List&lt;Group&gt; getGroups() {
          return this.businessGroups();
      }
  </code></pre>
  
  <p>I call load() function on load it triggers the function getGroups() and returns the list successfully but the problem is once the getGroups() is finished  </p>
  
  <p>function(data) doesn't load never gets into that function and the error is </p>
  
  <blockquote>
    <p>org.springframework.web.HttpMediaTypeNotAcceptableException:
    Could not find acceptable
    representation</p>
  </blockquote>
  
  <p>Can't I post back a list of Group objects, or does it have to be a Java primitive type?</p>