我正在使用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