I have created a custom JdbcDaoImpl Controller...
When I use the InMemoryDaoImpl authentication provider, it works fine.
When I run the queries on MySql, each of the queries works fine as well.
But when I use this JdbcDaoImpl controller with a username that _is_ in the database, I get:
If I try with a user that is _NOT_ in my database, I get:Code:13:18:19,439 INFO [STDOUT] 13:18:19,439 DEBUG [SQLErrorCodesFactory] SQL error codes for 'MySQL' found 13:18:19,439 INFO [STDOUT] 13:18:19,439 DEBUG [SQLErrorCodeSQLExceptionTranslator] Unable to translate SQLException with Error code '0', will now try the fallback translator 13:18:19,439 INFO [STDOUT] 13:18:19,439 DEBUG [XmlWebApplicationContext] Publishing event in context [Root WebApplicationContext]: org.acegisecurity.event .authentication.AuthenticationFailureServiceExceptionEvent[source=org.acegisecurity.providers.UsernamePasswordAuthenticationToken@4be0a7a9: Username: mknut son; Password: [PROTECTED]; Authenticated: false; Details: org.acegisecurity.ui.WebAuthenticationDetails@ffff6a82: RemoteIpAddress: 127.0.0.1; SessionId: 8 A6722D5B8165505C7569C7EA3196EA7; Not granted any authorities] 13:18:19,439 ERROR [STDERR] org.acegisecurity.AuthenticationServiceException: PreparedStatementCallback; uncategorized SQLException for SQL [ SELECT username, password FROM user WHERE username=? ]; SQL state [S1009]; error code [0]; Column Index out of range, 3 > 2. ; nested exception is java.sql.SQLException: Column Index out of range, 3 > 2. ; nested exception is org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [ SELECT username, password FROM user WHERE username=? ]; SQL state [S1009]; error code [0]; Column Index out of range, 3 > 2. ; nested exception is java.sql.SQLException: Column Index out of range, 3 > 2. 13:18:19,439 ERROR [STDERR] Caused by: 13:18:19,439 ERROR [STDERR] org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [ SELECT username, password FROM user WHERE username=? ]; SQL state [S1009]; error code [0]; Column Index out of range, 3 > 2. ; nested exception is java.sql.SQLException: Column Index out of range, 3 > 2. 13:18:19,439 ERROR [STDERR] Caused by: 13:18:19,439 ERROR [STDERR] java.sql.SQLException: Column Index out of range, 3 > 2. 13:18:19,439 ERROR [STDERR] at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:910) 13:18:19,439 ERROR [STDERR] at com.mysql.jdbc.ResultSet.checkColumnBounds(ResultSet.java:662) 13:18:19,439 ERROR [STDERR] at com.mysql.jdbc.ResultSet.getBoolean(ResultSet.java:1448) 13:18:19,439 ERROR [STDERR] at org.jboss.resource.adapter.jdbc.WrappedResultSet.getBoolean(WrappedResultSet.java:391) 13:18:19,439 ERROR [STDERR] at org.acegisecurity.userdetails.jdbc.JdbcDaoImpl$UsersByUsernameMapping.mapRow(JdbcDaoImpl.java:236) 13:18:19,439 ERROR [STDERR] at org.springframework.jdbc.object.MappingSqlQuery.mapRow(MappingSqlQuery.java:64) 13:18:19,439 ERROR [STDERR] at org.springframework.jdbc.object.MappingSqlQueryWithParameters$RowMapperImpl.mapRow(MappingSqlQueryWithParameters.java:11 5)
Code:14:09:25,962 INFO [STDOUT] 14:09:25,962 INFO [AuthenticationController] authenticate() 14:09:25,962 INFO [STDOUT] 14:09:25,962 DEBUG [AuthenticationController] getAuthenticationManager() 14:09:25,962 INFO [STDOUT] 14:09:25,962 DEBUG [ProviderManager] Authentication attempt using org.acegisecurity.providers.dao.DaoAuthenticationProvider 14:09:25,962 INFO [STDOUT] 14:09:25,962 DEBUG [JdbcTemplate] Executing SQL query [ SELECT username, password FROM user WHERE username=? ] 14:09:25,962 INFO [STDOUT] 14:09:25,962 DEBUG [DataSourceUtils] Fetching JDBC Connection from DataSource 14:09:25,978 INFO [STDOUT] 14:09:25,978 DEBUG [StatementCreatorUtils] Setting SQL statement parameter value: column index 1, parameter value [mickknutson] , value class [java.lang.String], SQL type 12 14:09:25,978 INFO [STDOUT] 14:09:25,978 DEBUG [DataSourceUtils] Returning JDBC Connection to DataSource 14:09:25,994 INFO [STDOUT] 14:09:25,994 DEBUG [XmlWebApplicationContext] Publishing event in context [Root WebApplicationContext]: org.acegisecurity.event .authentication.AuthenticationFailureBadCredentialsEvent[source=org.acegisecurity.providers.UsernamePasswordAuthenticationToken@653cb226: Username: mickknu tson; Password: [PROTECTED]; Authenticated: false; Details: org.acegisecurity.ui.WebAuthenticationDetails@ffff6a82: RemoteIpAddress: 127.0.0.1; SessionId: 8A6722D5B8165505C7569C7EA3196EA7; Not granted any authorities] 14:09:25,994 ERROR [STDERR] org.acegisecurity.BadCredentialsException: Bad credentials 14:09:25,994 ERROR [STDERR] at org.acegisecurity.providers.dao.AbstractUserDetailsAuthenticationProvider.authenticate(AbstractUserDetailsAuthentication Provider.java:118) 14:09:25,994 ERROR [STDERR] at org.acegisecurity.providers.ProviderManager.doAuthentication(ProviderManager.java:188) 14:09:25,994 ERROR [STDERR] at org.acegisecurity.AbstractAuthenticationManager.authenticate(AbstractAuthenticationManager.java:45) 14:09:25,994 ERROR [STDERR] at com.baselogic.tro.security.AuthenticationController.authenticate(AuthenticationController.java:98)



