title: Bean is initialized with @Controller but @RequestMapping doesn't get called
body: <p>Below is my setup for the new Spring 3 annotation based controller:</p>
  
  <p>// dispatcher-servlet.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns:p="http://www.springframework.org/schema/p"
         xmlns:aop="http://www.springframework.org/schema/aop"
         xmlns:tx="http://www.springframework.org/schema/tx"
         xmlns:context="http://www.springframework.org/schema/context"
         xmlns:security="http://www.springframework.org/schema/security"
         xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
         http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
         http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
         http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
         http://www.springframework.org/schema/security   http://www.springframework.org/schema/security/spring-security-3.0.xsd"&gt;
  
      &lt;bean class="org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping"/&gt;
  
  &lt;bean id="viewResolver"
            class="org.springframework.web.servlet.view.InternalResourceViewResolver"
            p:prefix="/WEB-INF/jsp/"
            p:suffix=".jsp" /&gt;
  
      &lt;!--
      The index controller.
      --&gt;
      &lt;bean name="indexController"
            class="org.springframework.web.servlet.mvc.ParameterizableViewController"
            p:viewName="index" /&gt;
  
   &lt;!-- Enables plain controllers --&gt;
      &lt;bean class="org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter" /&gt;
  
      &lt;bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver"&gt;
          &lt;property name="order" value="1" /&gt;
          &lt;property name="ignoreAcceptHeader" value="true" /&gt;
          &lt;property name="mediaTypes"&gt;
              &lt;map&gt;
                  &lt;entry key="xml" value="application/xml" /&gt;
                  &lt;entry key="json" value="application/json" /&gt;
              &lt;/map&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
  &lt;!-- Entity Property binding for webBindingInitializer --&gt;
      &lt;bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"&gt;
          &lt;property name="webBindingInitializer"&gt;
                  &lt;bean class="org.opevel.web.BindingInitializer" /&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
  &lt;context:component-scan base-package="org.opevel.web"/&gt;
  
  &lt;/beans&gt;
  </code></pre>
  
  <p>// web.xml</p>
  
  <pre><code>&lt;web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"&gt;
      &lt;context-param&gt;
          &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
          &lt;param-value&gt;/WEB-INF/applicationContext.xml&lt;/param-value&gt;
      &lt;/context-param&gt;
      &lt;listener&gt;
          &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
      &lt;/listener&gt;
      &lt;servlet&gt;
          &lt;servlet-name&gt;dispatcher&lt;/servlet-name&gt;
          &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
          &lt;load-on-startup&gt;2&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;dispatcher&lt;/servlet-name&gt;
          &lt;url-pattern&gt;*.htm&lt;/url-pattern&gt;
          &lt;url-pattern&gt;/auth&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
      &lt;session-config&gt;
          &lt;session-timeout&gt;
              30
          &lt;/session-timeout&gt;
  &lt;/session-config&gt;
  
  &lt;/web-app&gt;
  </code></pre>
  
  <p>// Spring controller</p>
  
  <pre><code>package org.opevel.web;
  
  @Controller
  public class LoginGoogleController {
  
  private static final Logger log = Logger.getLogger(LoginGoogleController.class.getName());
  
  public LoginGoogleController() {
      log.info("constructing LoginGoogleController");
  }
  
  @RequestMapping(value="/auth", method=RequestMethod.GET)
  public String doGet(HttpServletRequest request, HttpServletResponse response) throws Exception {
  
           return "redirect:index";
  
        }
  
      }
  </code></pre>
  
  <p>When I navigate to /auth, I get a 404. When I try to register the bean in the <code>applicationContext</code> like this: </p>
  
  <pre><code>&lt;bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"&gt;
          &lt;property name="mappings"&gt;
              &lt;props&gt;
              &lt;prop key="/auth"&gt;GoogleLoginService&lt;/prop&gt;
              &lt;/props&gt;
          &lt;/property&gt;
  
  &lt;bean id="GoogleLoginService" class="org.opevel.web.LoginGoogleController" /&gt;
  </code></pre>
  
  <p>I get a <code>BeanException</code> stating that the bean is already registered at <code>/logingoogle</code> through <code>ControllerClassNamehandlerMapping</code>. I am using Spring 3.0.2 on Google App Engine.</p>
  
  <p>Will appreciate some help.</p>