private UserDAO userDAO = null;
public UserDetails loadUserByUsername(String username)
throws AuthenticationException {
try {
User user = userDAO.findByUsername(username);
return new org.springframework.security.core.userdetails.User(user
.getUsername(), user.getPassword(), true, true, true, true,
AuthorityUtils.createAuthorityList("ROLE_USER"));
} catch (Exception e) {
LOG.error(e.getMessage(), e);
throw new UsernameNotFoundException("No matching account", e);
}