title: Spring is too long at returning cached instance of singleton bean
body: <p>Here's my log message.</p>
  
  <pre><code>09:24:21.633 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Finished creating instance of bean 'org.springframework.security.web.authentication.session.CompositeSessionAuthenticationStrategy#0'
  09:24:21.633 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating instance of bean '(inner bean)#32311ede'
  09:24:21.637 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Finished creating instance of bean '(inner bean)#32311ede'
  09:24:21.637 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.security.authentication.ProviderManager#0'
  09:24:21.638 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating instance of bean 'org.springframework.security.authentication.ProviderManager#0'
  09:24:21.638 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.security.authentication.AnonymousAuthenticationProvider#0'
  09:24:21.638 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating instance of bean 'org.springframework.security.authentication.AnonymousAuthenticationProvider#0'
  09:24:21.640 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Eagerly caching bean 'org.springframework.security.authentication.AnonymousAuthenticationProvider#0' to allow for resolving potential circular references
  09:24:21.643 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Invoking afterPropertiesSet() on bean with name 'org.springframework.security.authentication.AnonymousAuthenticationProvider#0'
  
  09:24:21.643 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Finished creating instance of bean 'org.springframework.security.authentication.AnonymousAuthenticationProvider#0'
  09:24:21.643 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.security.config.authentication.AuthenticationManagerFactoryBean#0'
  09:24:21.643 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating instance of bean 'org.springframework.security.config.authentication.AuthenticationManagerFactoryBean#0'
  09:24:21.644 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Eagerly caching bean 'org.springframework.security.config.authentication.AuthenticationManagerFactoryBean#0' to allow for resolving potential circular references
  09:24:21.647 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Finished creating instance of bean 'org.springframework.security.config.authentication.AuthenticationManagerFactoryBean#0'
  09:24:21.647 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.security.authenticationManager'
  09:24:21.648 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating instance of bean 'org.springframework.security.authenticationManager'
  09:24:21.648 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.security.authentication.dao.DaoAuthenticationProvider#0'
  09:24:21.648 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating instance of bean 'org.springframework.security.authentication.dao.DaoAuthenticationProvider#0'
  09:24:21.652 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Eagerly caching bean 'org.springframework.security.authentication.dao.DaoAuthenticationProvider#0' to allow for resolving potential circular references
  09:24:21.700 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'jasyptPasswordEncryption
  09:24:21.702 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'tenantDetailsService'
  </code></pre>
  
  <p>Here's my Configuration for Spring Security</p>
  
  <p>
  </p>
  
  <p>
      
      
      
      
      
          
      
  </p>
  
  <p>
  
      
      
          
          
      
  </p>
  
  <p>and the said classes</p>
  
  <pre><code>@Service
  public class TenantDetailsService implements UserDetailsService {
  
      @Autowired
      private UserAccountRepo userAccountRepo;
  
      @Override
      public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
          UserAccount account = userAccountRepo.findByUsername(username);
          if(account != null){
              List&lt;GrantedAuthority&gt; authorities = new ArrayList&lt;GrantedAuthority&gt;();
              authorities.add(new SimpleGrantedAuthority(account.getRole()));
              return new TenantUserDetails(account.getUsername(),
                      account.getPassword(),authorities,account.getTenantCode());
          }else{
              throw new UsernameNotFoundException("Bad Credentials");
          }
      }
  }
  </code></pre>
  
  <p>And the jasypt password encryption service</p>
  
  <pre><code>@Service
  public class JasyptPasswordEncryptionService implements PasswordEncryptionService,PasswordEncoder{
  
      private StrongPasswordEncryptor passwordEncryptor = new StrongPasswordEncryptor();
  
      @Override
      public String encode(CharSequence rawPassword) {
          return passwordEncryptor.encryptPassword(rawPassword.toString());
      }
  
      @Override
      public boolean matches(CharSequence rawPassword,String  encodedPassword) {
          try{
              return passwordEncryptor.checkPassword(rawPassword.toString(), encodedPassword);
          }catch (EncryptionOperationNotPossibleException encryptionOperationNotPossibleException){
              return  false;
          }
      }
  }
  </code></pre>
  
  <p>The problem was It already took me 30 mins and the build was still wasn't finish and I am stuck on that two lines. However, I changed my authentication manager to springs default authentication manager and it worked</p>
  
  <p>Have I configured my authentication manager wrong?</p>
  
  <p><strong>EDIT</strong>
  My existing configurations works on my windows machine, however on an ubuntu 14.04 it does not </p>