title: spring security dynamic roles to load from db
body: <p>my question is similar to post [question]: <a href="https://stackoverflow.com/questions/8381776/dynamic-spring-security-using-sql-query">Dynamic Spring Security using SQL Query</a></p>
  
  <p>I've tried the solution given by Rob Winch but spring security complains as such. So not sure whether this due to spring latest version 3.1 or something else I've missed. Any guidance is much appreciated.</p>
  
  <pre><code>Caused by: java.lang.ClassCastException: com.xx.web.security.filter.JdbcFilterInvocationSecurityMetadataSource cannot be cast to org.springframework.security.web.access.intercept.DefaultFilterInvocationSecurityMetadataSource
  </code></pre>