2011-01-06 48 views
2

我为Spring 2.5,asegi安全性1.0.7和我使用Tomcat 6作为我的开发服务器开发了一个项目的登录机制。当我开发项目时一切工作正常,我可以成功登录。当我在生产服务器上部署应用程序时,问题就开始了。从我在生产tomcat 6上部署应用程序的那一刻起,即使使用正确的用户名和密码,我也无法登录,并且最奇怪的是没有任何异常抛出。我只是不能登录-in! 这里是应用程序的应用程序的context.xml:?!Spring 2.5登录没有响应,即使使用正确的用户名/密码

 <bean id="authedicationProvider" class="org.acegisecurity.providers.dao.DaoAuthenticationProvider"> 
     <property name="userDetailsService" ref="userDetailService"/> 
    </bean> 
    <bean id="authenticationEntryPoint" class="org.acegisecurity.ui.webapp.AuthenticationProcessingFilterEntryPoint"> 
     <property name="loginFormUrl" value="/login.htm" /> 
    </bean> 
    <bean id="filterChainProxy" 
     class="org.acegisecurity.util.FilterChainProxy"> 
    <property name="filterInvocationDefinitionSource"> 
     <value> 
     CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON 
     PATTERN_TYPE_APACHE_ANT 
     /**=authenticationProcessingFilter,exceptionTranslationFilter 
     </value> 
    </property> 
    </bean> 
    <bean id="authenticationProcessingFilter" 
     class="org.acegisecurity.ui.webapp.AuthenticationProcessingFilter"> 
    <property name="authenticationManager" ref="authenticationManager"/> 
    <property name="authenticationFailureUrl" value="/error.htm" /> 
    <property name="defaultTargetUrl" value="/admin_menu.htm" /> 
    <property name="filterProcessesUrl" value="/j_acegi_security_check" /> 

    </bean> 
    <bean id="roleVoter" class="org.acegisecurity.vote.RoleVoter"/> 
    <bean id="accessDecisionManager" class="org.acegisecurity.vote.UnanimousBased"> 
     <property name="decisionVoters"> 
      <list> 
       <ref bean="roleVoter"/> 
      </list> 
     </property> 
     <property name="allowIfAllAbstainDecisions" value="true"/> 
    </bean> 
    <bean id="filterSecurityInterceptor" class="org.acegisecurity.intercept.web.FilterSecurityInterceptor"> 
     <property name="authenticationManager" ref="authenticationManager"/> 
     <property name="accessDecisionManager" ref="accessDecisionManager"/> 
     <property name="objectDefinitionSource"> 
      <value> 
       CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON 
       PATTERN_TYPE_APACHE_ANT 
       /add_article.htm=ROLE_ADMIN 
       /add_publication.htm=ROLE_ADMIN 
       /admin_menu.htm=ROLE_ADMIN 
      </value> 
     </bean> 
    </property> 
    </bean> 
    <bean id="authenticationManager" class="org.acegisecurity.providers.ProviderManager"> 
     <property name="providers"> 
      <list> 
       <ref bean="authedicationProvider"/> 
      </list> 
     </property> 
    </bean> 

    <bean id="userDetailService" class="org.acegisecurity.userdetails.jdbc.JdbcDaoImpl"> 
     <property name="dataSource" ref="datasource"/> 
     <property name="usersByUsernameQuery"> 
      <value> 
       SELECT username,password,'true' AS enabled FROM Users where username=? 
      </value> 
     </property> 
     <property name="authoritiesByUsernameQuery"> 
      <value> 
       SELECT username,role_name FROM Roles r,Users u WHERE r.user=u.id AND u.username=? 
      </value> 
     </property> 
    </bean> 

我失去了财产以后任何帮助将非常感激预先感谢您

+0

@kafrlust登录的用户是否有ROLE_ADMIN? defaultTargetUrl是需要此权限的页面。此外,通过将acegi的日志级别设置为DEBUG – Raghuram 2011-01-06 09:06:13

+0

,您可以获得更多信息。登录的用户具有ROLE_ADMIN!这是非常奇怪的,虽然我没有改变任何东西,当我的开发服务器工作正常,并且在现场服务器时它不! – kafrlust 2011-01-06 09:09:21

回答

0

难道这就是你在你的第一行有<bean id="authe**d**icationProvider"的应用程序文件?

相关问题