2011-01-06 46 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"的應用程序文件?

相關問題