title: Spring Security with Spring MVC does not working
body: <p>I'v just created a Spring MVC Project via Eclipse, and then i added this classes:</p>
  
  <pre><code>@Configuration
  @EnableWebMvcSecurity
  public class SpringSecurityConfig extends WebSecurityConfigurerAdapter {
  
      @Autowired
      public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
          auth.inMemoryAuthentication().withUser("user").password("password").roles("USER");
      }
  }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>public class SpringSecurityInitializer
        extends AbstractSecurityWebApplicationInitializer {
  
  }
  </code></pre>
  
  <p>just like <a href="http://docs.spring.io/spring-security/site/docs/3.2.5.RELEASE/reference/htmlsingle/" rel="nofollow">The Reference says</a>, but i am only getting an exception:</p>
  
  <pre><code>SEVERE: Exception starting filter springSecurityFilterChain
  org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'springSecurityFilterChain' is defined
  at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:529)
  at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1095)
  at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:277)
  at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
  at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1097)
  at org.springframework.web.filter.DelegatingFilterProxy.initDelegate(DelegatingFilterProxy.java:324)
  at org.springframework.web.filter.DelegatingFilterProxy.initFilterBean(DelegatingFilterProxy.java:235)
  at org.springframework.web.filter.GenericFilterBean.init(GenericFilterBean.java:199)
  at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)
  at org.apache.catalina.core.ApplicationFilterConfig.&lt;init&gt;(ApplicationFilterConfig.java:109)
  at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4615)
  at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5222)
  at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
  at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
  at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
  at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:714)
  at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:581)
  at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1683)
  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
  at java.util.concurrent.FutureTask.run(FutureTask.java:262)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
  at java.lang.Thread.run(Thread.java:745)
  </code></pre>
  
  <p>I am losing my mind with this, because i am not getting able to add security to my application, can you please help me with this headache?</p>
  
  <p>I added <code>@Order(1)</code> to my <code>SpringSecurityInitializer</code> and still not working with the same exception.
  Maybe i forgot something, just let me know ;)</p>