Spring security : java.sql.SQLException: Column Index out of range, 3 > 2

后端 未结 2 1009
星月不相逢
星月不相逢 2021-01-18 06:59

I\'m using spring 4 and I want to use spring security 3 to control my login form. So I have the following tables in database :

users table :

相关标签:
2条回答
  • 2021-01-18 07:54

    The users-by-username-query and authorities-by-username-query are mixed up. Move the first SQL query to the second and vice versa.

    Maybe you want to change 1 to users.enabled too.

    0 讨论(0)
  • 2021-01-18 07:59

    This error is because of column missing. The PreparedStatement is looking for 3 columns to get the 3 values and it finds only 2.

    The users-by-username-query and authorities-by-username-query required 3 columns in select.

    0 讨论(0)
提交回复
热议问题