专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > Java Exception

acegi权限验证,org.acegisecurity.AuthenticationServiceException: PreparedStatementCallback; uncategorized

发布时间:2010-06-05 12:25:51 文章来源:www.iduyao.cn 采编人员:星星草

acegi的配置(省略前面的,只把sql写出来了):
<bean id= "userDetailsService "
class= "org.acegisecurity.userdetails.jdbc.JdbcDaoImpl ">
<property name= "dataSource "> <ref bean= "dataSource "/> </property>

<property name= "usersByUsernameQuery ">
<value>
select name,passwd from users where name = ?
</value>
</property>
</bean>


异常:
2007-04-09 09:57:49,000 DEBUG [org.acegisecurity.ui.webapp.AuthenticationProcessingFilter] - <Authentication request failed: org.acegisecurity.AuthenticationServiceException: PreparedStatementCallback; uncategorized SQLException for SQL [
select name,passwd from users where name = ?
]; 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 name,passwd from users where name = ?
]; 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. >
2007-04-09 09:57:49,000 DEBUG [org.acegisecurity.context.HttpSessionContextIntegrationFilter] - <SecurityContextHolder set to new context, as request processing completed>
2007-04-09 09:57:49,000 DEBUG [org.apache.catalina.core.ApplicationDispatcher] - <servletPath=/commons/404.jsp, pathInfo=null, queryString=null, name=null>
2007-04-09 09:57:49,000 DEBUG [org.apache.catalina.core.ApplicationDispatcher] - < Path Based Forward>
2007-04-09 09:57:49,000 DEBUG [org.apache.jasper.servlet.JspServlet] - <JspEngine --> /commons/404.jsp>
2007-04-09 09:57:49,000 DEBUG [org.apache.jasper.servlet.JspServlet] - < ServletPath: /commons/404.jsp>
2007-04-09 09:57:49,000 DEBUG [org.apache.jasper.servlet.JspServlet] - < PathInfo: null>
2007-04-09 09:57:49,000 DEBUG [org.apache.jasper.servlet.JspServlet] - < RealPath: D:\Apache Software Foundation\Tomcat 5.5\webapps\springtest\commons\404.jsp>
2007-04-09 09:57:49,000 DEBUG [org.apache.jasper.servlet.JspServlet] - < RequestURI: /springtest/commons/404.jsp>
2007-04-09 09:57:49,000 DEBUG [org.apache.jasper.servlet.JspServlet] - < QueryString: null>
2007-04-09 09:57:49,000 DEBUG [org.apache.jasper.servlet.JspServlet] - < Request Params: >

问题:
1。这个越界怎么解释呢?
2。就算失败,怎么转到404。jsp呢,我在authenticationProcessingFilter里面定义了authenticationFailureUrl的啊?

------解决方法--------------------------------------------------------
1.是因为你项目中使用的数据库登录用户没有操作users这个表的权限。
2.不知道authenticationProcessingFilter这个里面你是怎么处理的,但是你要控制错误页面的话,可以在web.xml设置error-page:
<error-page>
<error-code> 404 </error-code>
<location> /*.jsp </location>
</error-page>

    
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

热门推荐: