title: Spring 4, JSON - HTTP Error 406 Not Acceptable
body: <p>I've created controller for fullCalendar eventSource, unfortunatelly something went wrong and every time I try to open this page I got HTTP ERROR 406.</p>
  
  <p>My Controller:</p>
  
  <pre><code>@RequestMapping(value="/schedule", method = RequestMethod.GET)
  public @ResponseBody Object getEventyJSON(Principal principal){
      String name = principal.getName();
      List&lt;Eventy&gt; eventy = userService.findOneWithEventy(name).getEventy();
  
      List&lt;HashMap&lt;String,String&gt;&gt; events = new ArrayList&lt;HashMap&lt;String,String&gt;&gt;();
  
      for (int i = 0; i &lt; eventy.size(); i++) {
          HashMap&lt;String,String&gt; map = new HashMap&lt;String,String&gt;();
          map.put("title", eventy.get(i).getTitle());
          map.put("start", eventy.get(i).getStart());
          events.add(map);
      }
  
      return events;
  }
  </code></pre>
  
  <p>My POM.xml</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
      &lt;artifactId&gt;jackson-core&lt;/artifactId&gt;
      &lt;version&gt;2.4.1&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
      &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
      &lt;artifactId&gt;jackson-databind&lt;/artifactId&gt;
      &lt;version&gt;2.4.1.1&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>Of course I've tried to change dependency to codehaus instead of fasterxml and it's not working. Also I've tried to add some headers to method.</p>
  
  <p>When i change controller to this:</p>
  
  <pre><code>@RequestMapping(value="/schedule", method = RequestMethod.GET)
      public @ResponseBody Object getEventyJSON(Principal principal){
          String name = principal.getName();
          List&lt;Eventy&gt; eventy = userService.findOneWithEventy(name).getEventy();
  
  
          return "schedule";
      }
  </code></pre>
  
  <p>It is working and when I open that page it print schedule so it is correct.
  What am I missing?</p>