我在 mysql 数据库之上使用 spring MVC 框架。我正在尝试使用数据库中现有的 user_login 实体属性验证登录页面。我遵循了这个信息丰富的教程:
https://dzone.com/articles/spring-security-4-authenticate-and-authorize-users
这是我与此相关的第二个问题,所以我一定做错了什么。我曾尝试实施本教程的部分内容,但似乎无法克服此错误:
2017-12-14 16:01:40.458 ERROR 12116 --- [nio-8080-exec-2] w.a.UsernamePasswordAuthenticationFilter : An internal error occurred while trying to authenticate the user.
2017-12-14 17:21:45.890 ERROR 4504 --- [nio-8080-exec-9] w.a.UsernamePasswordAuthenticationFilter : An internal error occurred while trying to authenticate the user.
org.springframework.security.authentication.InternalAuthenticationServiceException: PreparedStatementCallback; SQL [select email, password from user_login where email=?]; Column Index out of range, 3 > 2. ; nested exception is java.sql.SQLException: Column Index out of range, 3 > 2.
at org.springframework.security.authentication.dao.DaoAuthenticationProvider.retrieveUser(DaoAuthenticationProvider.java:126) ~[spring-security-core-4.2.3.RELEASE.jar:4.2.3.RELEASE] …Run Code Online (Sandbox Code Playgroud)