title: spring controller being called twice
body: <p>This is driving me nuts. I have a simple spring app with just a servlet context file configured like this:</p>
  
  <pre><code>&lt;context:component-scan base-package="au.com.mypackage.service" /&gt;
  &lt;context:annotation-config /&gt;
  &lt;mvc:annotation-driven /&gt;
  </code></pre>
  
  <p>And a simple controller:</p>
  
  <pre><code>@Controller
  public class MyController {
  
      @RequestMapping(value = "/data/{id}", method=RequestMethod.GET)
      @ResponseBody public Bean getData(@PathVariable String id) {
          Bean bean = new Bean();
          bean.setSomething("hello");
          bean.setSomethingElse(5);
          return bean;
      }
  </code></pre>
  
  <p>Which makes use of message converters to do it's work. I then submit this request from SoapUI:</p>
  
  <pre><code>GET http://localhost:8080/spring/data/123 HTTP/1.1
  
  Accept-Encoding: gzip,deflate
  
  Accept: application/json
  
  User-Agent: Jakarta Commons-HttpClient/3.1
  
  Host: localhost:8080
  </code></pre>
  
  <p>And it appears to work ok. BUT, when I look in the tomcat logs I see that the controller is called twice. This is ok for JSON. But when I switch to requesting XML it goes horribly wrong. The second request (which should not happen anyway) triggers as massive error in XStream because of socket closures, etc.</p>
  
  <p>The root of the problem is the calling of the controller twice. Does anyone know why this would be happening?</p>