我正在使用Spring Security 3.1爲用戶驗證網站。當因爲春季安全是無法連接到數據庫的登錄失敗,我得到下面的語句在我的日誌:Spring安全認證日誌記錄
2012-07-12 11:42:45,419 [ajp-bio-8009-exec-1] DEBUG org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter - Authentication request failed: org.springframework.security.authentication.AuthenticationServiceException: Could not get JDBC Connection; nested exception is java.sql.SQLException: Connections could not be acquired from the underlying database!
我的問題是,爲什麼這是一個DEBUG語句,而不是一個錯誤?我必須通過大量的調試語句來查找實際的錯誤。
編輯
這裏是我的認證管理器:
<bean id="securityDataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:comp/env/securityDS"/>
<property name="resourceRef" value="true"/>
</bean>
<bean id="encoder" class="org.springframework.security.crypto.password.StandardPasswordEncoder" />
<security:authentication-manager>
<security:authentication-provider>
<security:password-encoder ref="encoder" />
<security:jdbc-user-service
data-source-ref="securityDataSource"
authorities-by-username-query="SELECT username, authority FROM login WHERE username = ?"
users-by-username-query="SELECT username, password, enabled FROM login WHERE username = ?"
/>
</security:authentication-provider>
</security:authentication-manager>
如何找出我正在使用的UserDetailService類型? – 2012-07-13 13:25:06
你可以發佈你的配置的''部分嗎? –
sourcedelica
2012-07-13 15:09:31
問題已更新。 – 2012-07-13 15:25:15