Error creating bean with name ‘springSecurityFilterChain’

I copied your spring security configuration and was able to reproduce the error.

Following line in the stacktrace gives the root cause of the exception:

at org.springframework.security.provisioning.InMemoryUserDetailsManager.createUser(InMemoryUserDetailsManager.java:59)

In InMemoryUserDetailsManager class, createUser() method, Spring checks if the user exists before creating an user. In your case you are adding two user with same username, hence there is an IllegalArgumentException.

I added two users with different usernames and it started working fine.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)