title: beans.NotReadablePropertyException in spring security
body: <p>I am very new to spring security . I picked up <a href="https://rads.stackoverflow.com/amzn/click/com/1847199747" rel="noreferrer" rel="nofollow noreferrer">this</a> book and trying to execute the code .</p>
  
  <p>While I do this I am getting </p>
  
  <pre><code>org.springframework.beans.NotReadablePropertyException: Invalid property
  'principal.username' of bean class 
  [org.springframework.security.authentication.AnonymousAuthenticationToken]: 
  Bean property 'principal.username' is not readable or has an invalid getter 
  method: 
  Does the return type of the getter match the parameter type of the setter?
  </code></pre>
  
  <p>My spring-security xml config :</p>
  
  <pre><code>&lt;http auto-config="true" use-expressions="true"&gt;
      &lt;intercept-url pattern="/login.do" access="permitAll"/&gt;
      &lt;intercept-url pattern="/*" access="hasRole('ROLE_USER')"/&gt;
      &lt;form-login login-page="/login.do"/&gt;
  &lt;/http&gt;
  
  
  &lt;authentication-manager alias="authenticationManager"&gt;
  
      &lt;authentication-provider&gt;
          &lt;user-service id="userService"&gt;
              &lt;user authorities="ROLE_USER" name="guest" password="guest"/&gt;
          &lt;/user-service&gt;
      &lt;/authentication-provider&gt;
      &lt;!-- Ch 3 Change Password Service --&gt;
      &lt;!-- 
      &lt;authentication-provider user-service-ref="userService"/&gt;
       --&gt;
  &lt;/authentication-manager&gt;
  </code></pre>
  
  <p>Am I missing something ?</p>
  
  <p>Let me know if you need any additional information.</p>