小编Gav*_*ere的帖子

列索引超出范围,3 > 2。; 嵌套异常是 java.sql.SQLException:

我在 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)

java mysql authentication login spring-mvc

3
推荐指数
1
解决办法
2452
查看次数

标签 统计

authentication ×1

java ×1

login ×1

mysql ×1

spring-mvc ×1