title: Spring3 Security using JDBC and stopped working
body: <p>Spring 3 using Spring Security should be easy but I know I am doing something not right.  I am making a sample Spring3 Web App and I used Spring Security for my web app. After two weeks of debug and not getting it working I found out it was something in my web.xml and now it works great.  But I need to move the users from the XML file to a MySQL database.  So I remove the users from the XML file and change my file to look like the following:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
      &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"
             xmlns:jdbc="http://www.springframework.org/schema/jdbc"
             xsi:schemaLocation="http://www.springframework.org/schema/beans
             http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
             http://www.springframework.org/schema/jdbc
             http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd
             http://www.springframework.org/schema/security
             http://www.springframework.org/schema/security/spring-security-3.0.xsd"&gt;
          &lt;http auto-config="true"&gt;
              &lt;intercept-url pattern="/friends/**" access="ROLE_USER" /&gt;
              &lt;intercept-url pattern="/articles/**" access="ROLE_USER" /&gt;
              &lt;intercept-url pattern="/**" access="IS_AUTHENTICATED_ANONYMOUSLY" /&gt;
          &lt;/http&gt;
      &lt;authentication-manager alias="authenticationManager"&gt;
          &lt;authentication-provider&gt;
              &lt;jdbc-user-service data-source-ref="dataSource"/&gt;
          &lt;/authentication-provider&gt;
      &lt;/authentication-manager&gt;
  &lt;/beans:beans&gt;
  </code></pre>
  
  <p>I made my SQL database with the following:</p>
  
  <pre><code>CREATE TABLE IF NOT EXISTS `authorities` (
    `username` varchar(50) NOT NULL,
    `authority` varchar(50) NOT NULL,
    UNIQUE KEY `authorities_idx_1` (`username`,`authority`)
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  INSERT INTO `authorities` (`username`, `authority`) VALUES
  ('admin', 'ROLE_ADMIN'),
  ('admin', 'ROLE_USER'),
  ('guest', 'ROLE_USER');
  
  
  CREATE TABLE IF NOT EXISTS `users` (
    `username` varchar(50) NOT NULL,
    `password` varchar(50) NOT NULL,
    `enabled` tinyint(1) NOT NULL,
    PRIMARY KEY (`username`)
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  
  INSERT INTO `users` (`username`, `password`, `enabled`) VALUES
  ('admin', 'admin', 1),
  ('guest', 'guest', 1),
  ('john', 'sabrina', 1);
  </code></pre>
  
  <p>Can someone please tell me why it is not working!  I need help</p>