title: Spring-Social/Twitter -- ConnectController doesn't respond to /connect?
body: <p>OK so I've been pulling my hair for ages now (at least so it seems!) trying to figure out what i'm doing wrong: I have a Java project in which I want to allow users who log in (via normal Spring-Security JDBC enabled repository) to grant access to their Twitter account to my application. I have registered an app with Twitter etc and have secret and access keys and everything else required to test, however, despite all the docco's read and all the configurations tried, even though my spring config creates a <code>ConnectController</code>, whenever I hit the <code>/connect/twitter</code> I get a 404 (not found) though there is absolutely no error generated during the context coming up in Tomcat and everything else works fine (i.e all my beans get instantianted and all the views / controllers work etc). </p>
  
  <p>To my understanding -- though I do struggle with the Spring Social docco, even more so as a few of the examples shown only work on specific versions! -- simply instantiating this controller should take care of the rest -- but perhaps I'm wrong???</p>
  
  <p>Here's what my config looks like -- yes it's a bit allover the place:</p>
  
  <p><strong>/WEB-INF/web.xml</strong></p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"&gt;
  &lt;web-app&gt;
      &lt;display-name&gt;legototies&lt;/display-name&gt;
      &lt;servlet&gt;
          &lt;servlet-name&gt;legototies&lt;/servlet-name&gt;
          &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
          &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
  
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;legototies&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
      &lt;!-- allow robots.txt --&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;default&lt;/servlet-name&gt;
          &lt;url-pattern&gt;*.txt&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
      &lt;!-- allow favicon.ico --&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;default&lt;/servlet-name&gt;
          &lt;url-pattern&gt;*.ico&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
      &lt;!-- allow everything under /static/ --&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;default&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/static/*&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
      &lt;listener&gt;
          &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
      &lt;/listener&gt;
  
      &lt;context-param&gt;
          &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
          &lt;param-value&gt;
              /WEB-INF/applicationContext.xml,
              /WEB-INF/spring-security.xml
          &lt;/param-value&gt;
      &lt;/context-param&gt;
  
      &lt;!-- Spring Security --&gt;
      &lt;filter&gt;
          &lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt;
          &lt;filter-class&gt;
              org.springframework.web.filter.DelegatingFilterProxy
          &lt;/filter-class&gt;
      &lt;/filter&gt;
  
      &lt;filter-mapping&gt;
          &lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt;
          &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
      &lt;/filter-mapping&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p><strong>/WEB-INF/legototies-servlet.xml</strong></p>
  
  <pre class="lang-xml prettyprint-override"><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:context="http://www.springframework.org/schema/context"
      xmlns:mvc="http://www.springframework.org/schema/mvc"
      xsi:schemaLocation="
          http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
          http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd
          http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd"&gt;
  
      &lt;context:component-scan base-package="com.lt" /&gt;
  
      &lt;bean id="viewResolver"
          class="org.springframework.web.servlet.view.InternalResourceViewResolver" p:order="1"&gt;
          &lt;property name="viewClass" value="org.springframework.web.servlet.view.JstlView" /&gt;
          &lt;property name="prefix" value="/WEB-INF/jsp/" /&gt;
          &lt;property name="suffix" value=".jsp" /&gt;
      &lt;/bean&gt;
      &lt;bean id="tilesviewResolver" class="org.springframework.web.servlet.view.tiles2.TilesViewResolver" p:order="0"/&gt;
  
      &lt;bean id="tilesConfigurer" class="org.springframework.web.servlet.view.tiles2.TilesConfigurer"&gt;
          &lt;property name="definitions"&gt;
              &lt;list&gt;
                  &lt;value&gt;/WEB-INF/tiles.xml&lt;/value&gt;
              &lt;/list&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
  &lt;/beans&gt;
  </code></pre>
  
  <p><strong>/WEB-INF/applicationContext.xml</strong></p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:context="http://www.springframework.org/schema/context"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:task="http://www.springframework.org/schema/task"
      xmlns:twitter="http://www.springframework.org/schema/social/twitter"
      xmlns:social="http://www.springframework.org/schema/social"
      xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
         http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd
         http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.2.xsd
         http://www.springframework.org/schema/social/twitter http://www.springframework.org/schema/social/spring-social-twitter.xsd
         http://www.springframework.org/schema/social http://www.springframework.org/schema/social/spring-social-1.1.xsd"&gt;
  
      &lt;!-- **** BEGIN: Config files **** --&gt;
      &lt;bean
          class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"&gt;
          &lt;property name="locations"&gt;
              &lt;list&gt;
                  &lt;value&gt;classpath*:config/*.properties&lt;/value&gt;
              &lt;/list&gt;
          &lt;/property&gt;
          &lt;property name="ignoreResourceNotFound" value="true" /&gt;
      &lt;/bean&gt;
      &lt;!-- **** END: Config files **** --&gt;
  
      &lt;context:component-scan base-package="com.lt" /&gt;
  
  
      &lt;!-- **** BEGIN: Database **** --&gt;
      &lt;bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
          destroy-method="close"&gt;
          &lt;property name="driverClassName" value="${database.driverClassName}" /&gt;
          &lt;property name="url" value="${database.url}" /&gt;
          &lt;property name="username" value="${database.username}" /&gt;
          &lt;property name="password" value="${database.password}" /&gt;
          &lt;property name="initialSize" value="${database.initial.size}" /&gt;
          &lt;property name="maxActive" value="${database.max.active}" /&gt;
      &lt;/bean&gt;
      &lt;bean id="localJdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate"&gt;
          &lt;constructor-arg&gt;
              &lt;ref bean="dataSource" /&gt;
          &lt;/constructor-arg&gt;
      &lt;/bean&gt;
  
      &lt;bean id="txManager"
          class="org.springframework.jdbc.datasource.DataSourceTransactionManager"&gt;
          &lt;property name="dataSource" ref="dataSource" /&gt;
      &lt;/bean&gt;
  
      &lt;bean id="sessionFactory"
          class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"&gt;
          &lt;property name="configLocation"&gt;
              &lt;value&gt;classpath:hibernate.cfg.xml&lt;/value&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
      &lt;!-- **** END: Database **** --&gt;
  
  
      &lt;bean id="messageAssembler" class="com.lt.message.MessageAssembler" /&gt;
  
  
      &lt;!-- **** BEGIN: Scheduler **** --&gt;
      &lt;!-- Tasks --&gt;
      &lt;bean id="createTweetsScheduler" class="com.lt.scheduller.CreateTweetsScheduler"&gt;
          &lt;constructor-arg index="0" ref="sessionFactory" /&gt;
          &lt;constructor-arg index="1" ref="execSendTweet" /&gt;
          &lt;constructor-arg index="2" ref="messageAssembler" /&gt;
      &lt;/bean&gt;
      &lt;bean id="bookScrapingNeededTask" class="com.lt.scheduller.BooksScrapingNeededCheckTask"&gt;
          &lt;constructor-arg index="0" ref="sessionFactory" /&gt;
          &lt;constructor-arg index="1" ref="execPageScraping" /&gt;
          &lt;constructor-arg index="2" value="${shefari.htmlpath}" /&gt;
      &lt;/bean&gt;
  
      &lt;!-- Schedulers --&gt;
      &lt;task:executor id="execPageScraping" pool-size="${page.scrape.threadpool.size}" /&gt;
      &lt;task:executor id="execSendTweet" pool-size="${broadcastTweets.threadpool.size}" /&gt;
  
      &lt;task:scheduler id="mainScheduler" pool-size="${mainScheduler.size}" /&gt;
      &lt;task:scheduled-tasks scheduler="mainScheduler"&gt;
          &lt;task:scheduled ref="createTweetsScheduler" method="run"
              fixed-rate="${selectTweets.period.ms}" initial-delay="${selectTweets.initial.delay.ms}" /&gt;
          &lt;task:scheduled ref="bookScrapingNeededTask" method="run"
              fixed-rate="${page.scrape.check.period.ms}" initial-delay="${page.scrape.check.initial.delay.ms}" /&gt;
      &lt;/task:scheduled-tasks&gt;
      &lt;!-- **** END: Scheduler **** --&gt;
  
  
      &lt;bean id="textEncryptor" class="org.springframework.security.crypto.encrypt.Encryptors"
          factory-method="noOpText" /&gt;
      &lt;bean id="passwordEncoder"
          class="org.springframework.security.crypto.password.NoOpPasswordEncoder"
          factory-method="getInstance" /&gt;
  
  
      &lt;!-- **** BEGIN: twitter/social **** --&gt;
      &lt;social:jdbc-connection-repository /&gt;
      &lt;twitter:config app-id="${twitter.app.consumer.key}"
          app-secret="${twitter.app.consumer.secret}" /&gt;
      &lt;bean id="userIdSource"
          class="org.springframework.social.security.AuthenticationNameUserIdSource" /&gt;
      &lt;bean id="connectController"
          class="org.springframework.social.connect.web.ConnectController"&gt;
          &lt;property name="connectInterceptors"&gt;
              &lt;list&gt;
                  &lt;bean class="com.lt.utils.TweetAfterConnectInterceptor"&gt;
                      &lt;constructor-arg index="0" value="${twitter.app.connect.msg}" /&gt;
                  &lt;/bean&gt;
              &lt;/list&gt;
          &lt;/property&gt;
          &lt;property name="applicationUrl" value="http://localhost:8080/" /&gt;
      &lt;/bean&gt;
      &lt;!-- **** END: twitter/social **** --&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p><strong>/WEB-INF/spring-security.xml</strong></p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;beans:beans xmlns="http://www.springframework.org/schema/security"
      xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
      http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd"&gt;
  
      &lt;global-method-security secured-annotations="enabled" /&gt;
  
      &lt;http auto-config="true" use-expressions="true"&gt;
          &lt;intercept-url pattern="/static/**" access="permitAll" /&gt;
          &lt;intercept-url pattern="/home" access="permitAll" /&gt;
          &lt;intercept-url pattern="/**" access="hasRole('ROLE_USER')" /&gt;
      &lt;/http&gt;
  
      &lt;authentication-manager&gt;
          &lt;authentication-provider&gt;
              &lt;jdbc-user-service data-source-ref="dataSource"
  
             users-by-username-query="select username,password, enabled from users where username=?" 
  
             authorities-by-username-query="select u.username, ur.authority from users u, user_roles ur 
                where u.id = ur.user_id and u.username =?  " 
  
              /&gt;
          &lt;/authentication-provider&gt;
      &lt;/authentication-manager&gt;
  &lt;/beans:beans&gt;
  </code></pre>
  
  <p>I'm not including here <strong>/WEB-INF/tiles.xml</strong> as I don't think it's relevant -- it just defines some basic templates.</p>
  
  <p>Lastly, this is the project <strong>pom.xml</strong> -- please note that I'm using the latest spring social milestone (M4):</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;groupId&gt;liviutudor&lt;/groupId&gt;
      &lt;artifactId&gt;legototies&lt;/artifactId&gt;
      &lt;packaging&gt;war&lt;/packaging&gt;
      &lt;version&gt;1.0.0-SNAPSHOT&lt;/version&gt;
      &lt;name&gt;legototies&lt;/name&gt;
      &lt;inceptionYear&gt;2013&lt;/inceptionYear&gt;
      &lt;description&gt;This is "lego toties"&lt;/description&gt;
      &lt;url&gt;http://legototies.com&lt;/url&gt;
      &lt;developers&gt;
          &lt;developer&gt;
              &lt;name&gt;Liviu Tudor&lt;/name&gt;
              &lt;id&gt;liviut&lt;/id&gt;
              &lt;email&gt;me at liviutudor.com&lt;/email&gt;
          &lt;/developer&gt;
      &lt;/developers&gt;
      &lt;repositories&gt;
          &lt;repository&gt;
              &lt;snapshots&gt;
                  &lt;enabled&gt;false&lt;/enabled&gt;
              &lt;/snapshots&gt;
              &lt;id&gt;central&lt;/id&gt;
              &lt;name&gt;Maven Repository Switchboard&lt;/name&gt;
              &lt;url&gt;http://repo1.maven.org/maven2&lt;/url&gt;
          &lt;/repository&gt;
          &lt;repository&gt;
              &lt;id&gt;spring-snapshots&lt;/id&gt;
              &lt;name&gt;Spring Snapshots&lt;/name&gt;
              &lt;url&gt;http://repo.spring.io/snapshot&lt;/url&gt;
              &lt;snapshots&gt;
                  &lt;enabled&gt;true&lt;/enabled&gt;
              &lt;/snapshots&gt;
          &lt;/repository&gt;
          &lt;repository&gt;
              &lt;id&gt;spring-milestones&lt;/id&gt;
              &lt;name&gt;Spring Milestones&lt;/name&gt;
              &lt;url&gt;http://repo.spring.io/milestone&lt;/url&gt;
              &lt;snapshots&gt;
                  &lt;enabled&gt;false&lt;/enabled&gt;
              &lt;/snapshots&gt;
          &lt;/repository&gt;
      &lt;/repositories&gt;
  
      &lt;properties&gt;
          &lt;project.build.jdkVersion&gt;1.6&lt;/project.build.jdkVersion&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
  
          &lt;hibernate.version&gt;3.6.10.Final&lt;/hibernate.version&gt;
          &lt;jsoup.version&gt;1.7.2&lt;/jsoup.version&gt;
          &lt;junit.version&gt;4.10&lt;/junit.version&gt;
          &lt;spring.version&gt;3.2.3.RELEASE&lt;/spring.version&gt;
          &lt;spring.social.version&gt;1.1.0.M4&lt;/spring.social.version&gt;
          &lt;spring.security.version&gt;3.1.4.RELEASE&lt;/spring.security.version&gt;
          &lt;tiles.version&gt;2.2.2&lt;/tiles.version&gt;
      &lt;/properties&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
              &lt;artifactId&gt;servlet-api&lt;/artifactId&gt;
              &lt;version&gt;2.5&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
              &lt;artifactId&gt;jstl&lt;/artifactId&gt;
              &lt;version&gt;1.2&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Spring --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-core&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-aop&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
              &lt;exclusions&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;commons-logging&lt;/groupId&gt;
                      &lt;artifactId&gt;commons-logging&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
              &lt;/exclusions&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-jdbc&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-orm&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-web&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-webmvc&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
              &lt;exclusions&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;commons-logging&lt;/groupId&gt;
                      &lt;artifactId&gt;commons-logging&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
              &lt;/exclusions&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-context&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Spring security --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
              &lt;artifactId&gt;spring-security-core&lt;/artifactId&gt;
              &lt;version&gt;${spring.security.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
              &lt;artifactId&gt;spring-security-web&lt;/artifactId&gt;
              &lt;version&gt;${spring.security.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
              &lt;artifactId&gt;spring-security-config&lt;/artifactId&gt;
              &lt;version&gt;${spring.security.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
              &lt;artifactId&gt;spring-security-taglibs&lt;/artifactId&gt;
              &lt;version&gt;${spring.security.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt; &lt;!-- needed by spring social twitter --&gt;
              &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
              &lt;artifactId&gt;spring-security-crypto&lt;/artifactId&gt;
              &lt;version&gt;${spring.security.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;!-- Spring Social --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.social&lt;/groupId&gt;
              &lt;artifactId&gt;spring-social-twitter&lt;/artifactId&gt;
              &lt;version&gt;${spring.social.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.social&lt;/groupId&gt;
              &lt;artifactId&gt;spring-social-web&lt;/artifactId&gt;
              &lt;version&gt;${spring.social.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.social&lt;/groupId&gt;
              &lt;artifactId&gt;spring-social-security&lt;/artifactId&gt;
              &lt;version&gt;${spring.social.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Hibernate --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-core&lt;/artifactId&gt;
              &lt;version&gt;${hibernate.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-entitymanager&lt;/artifactId&gt;
              &lt;version&gt;${hibernate.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate.javax.persistence&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-jpa-2.0-api&lt;/artifactId&gt;
              &lt;version&gt;1.0.0.Final&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;!-- this is needed for hibernate --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javassist&lt;/groupId&gt;
              &lt;artifactId&gt;javassist&lt;/artifactId&gt;
              &lt;version&gt;3.12.0.GA&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;mysql&lt;/groupId&gt;
              &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
              &lt;version&gt;5.0.5&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;commons-dbcp&lt;/groupId&gt;
              &lt;artifactId&gt;commons-dbcp&lt;/artifactId&gt;
              &lt;version&gt;1.4&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.commons&lt;/groupId&gt;
              &lt;artifactId&gt;commons-lang3&lt;/artifactId&gt;
              &lt;version&gt;3.1&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.jsoup&lt;/groupId&gt;
              &lt;artifactId&gt;jsoup&lt;/artifactId&gt;
              &lt;version&gt;${jsoup.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.tiles&lt;/groupId&gt;
              &lt;artifactId&gt;tiles-extras&lt;/artifactId&gt;
              &lt;version&gt;${tiles.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Test dependencies --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;junit&lt;/groupId&gt;
              &lt;artifactId&gt;junit&lt;/artifactId&gt;
              &lt;version&gt;${junit.version}&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-test&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
      &lt;build&gt;
          &lt;finalName&gt;legototies&lt;/finalName&gt;
          &lt;defaultGoal&gt;install&lt;/defaultGoal&gt;
          &lt;resources&gt;
              &lt;resource&gt;
                  &lt;filtering&gt;false&lt;/filtering&gt;
                  &lt;directory&gt;src/main/java&lt;/directory&gt;
                  &lt;includes&gt;
                      &lt;include&gt;**/*.properties&lt;/include&gt;
                      &lt;include&gt;**/*.xml&lt;/include&gt;
                  &lt;/includes&gt;
              &lt;/resource&gt;
              &lt;resource&gt;
                  &lt;filtering&gt;false&lt;/filtering&gt;
                  &lt;directory&gt;src/main/resources&lt;/directory&gt;
                  &lt;includes&gt;
                      &lt;include&gt;**/*.properties&lt;/include&gt;
                      &lt;include&gt;**/*.xml&lt;/include&gt;
                  &lt;/includes&gt;
              &lt;/resource&gt;
          &lt;/resources&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;${project.build.jdkVersion}&lt;/source&gt;
                      &lt;target&gt;${project.build.jdkVersion}&lt;/target&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-resources-plugin&lt;/artifactId&gt;
                  &lt;configuration&gt;
                      &lt;encoding&gt;${project.build.sourceEncoding}&lt;/encoding&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>As I said everything works just fine, however, given the above, even though there is a <code>ConnectController</code> defined, the <code>/connect/twitter</code> (or any other <code>/connect/...</code> URL) returns 404 not found. What am I missing?</p>
  
  <p><strong>Update: Logging segment regarding the connect controller</strong></p>
  
  <pre><code>5148 [main] INFO org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Mapped "{[/connect/{providerId}],methods=[POST],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public org.springframework.web.servlet.view.RedirectView org.springframework.social.connect.web.ConnectController.connect(java.lang.String,org.springframework.web.context.request.NativeWebRequest)
  5148 [main] INFO org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Mapped "{[/connect/{providerId}],methods=[DELETE],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public org.springframework.web.servlet.view.RedirectView org.springframework.social.connect.web.ConnectController.removeConnections(java.lang.String,org.springframework.web.context.request.NativeWebRequest)
  5148 [main] INFO org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Mapped "{[/connect/{providerId}/{providerUserId}],methods=[DELETE],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public org.springframework.web.servlet.view.RedirectView org.springframework.social.connect.web.ConnectController.removeConnection(java.lang.String,java.lang.String,org.springframework.web.context.request.NativeWebRequest)
  5149 [main] INFO org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Mapped "{[/connect/{providerId}],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String org.springframework.social.connect.web.ConnectController.connectionStatus(java.lang.String,org.springframework.web.context.request.NativeWebRequest,org.springframework.ui.Model)
  5150 [main] INFO org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Mapped "{[/connect],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String org.springframework.social.connect.web.ConnectController.connectionStatus(org.springframework.web.context.request.NativeWebRequest,org.springframework.ui.Model)
  5150 [main] INFO org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Mapped "{[/connect/{providerId}],methods=[GET],params=[oauth_token],headers=[],consumes=[],produces=[],custom=[]}" onto public org.springframework.web.servlet.view.RedirectView org.springframework.social.connect.web.ConnectController.oauth1Callback(java.lang.String,org.springframework.web.context.request.NativeWebRequest)
  5151 [main] INFO org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Mapped "{[/connect/{providerId}],methods=[GET],params=[code],headers=[],consumes=[],produces=[],custom=[]}" onto public org.springframework.web.servlet.view.RedirectView org.springframework.social.connect.web.ConnectController.oauth2Callback(java.lang.String,org.springframework.web.context.request.NativeWebRequest)
  5152 [main] INFO org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Mapped "{[/connect/{providerId}],methods=[GET],params=[error],headers=[],consumes=[],produces=[],custom=[]}" onto public org.springframework.web.servlet.view.RedirectView org.springframework.social.connect.web.ConnectController.oauth2ErrorCallback(java.lang.String,java.lang.String,java.lang.String,java.lang.String,org.springframework.web.context.request.NativeWebRequest)
  </code></pre>