Results 1 to 5 of 5

Thread: Can to get resource file -> HTTP 404 exception

  1. #1
    Join Date
    Nov 2006
    Posts
    14

    Default Can to get resource file -> HTTP 404 exception

    Hi All,

    I am so confused bucase system runs well in my local windows OS.
    But when I move to another server and try to visit http://192.168.0.23:8400/olrp/index.jsp, it shows page not found exception.

    It's same as /j_acegi_security_check and others resources

    acegi security configuration file is:

    HTML Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
    
    <beans>
    
    	<bean id="filterChainProxy" class="org.acegisecurity.util.FilterChainProxy">
    		<property name="filterInvocationDefinitionSource">
    			<value>
    				CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
    				PATTERN_TYPE_APACHE_ANT
    /**=httpSessionContextIntegrationFilter,logoutFilter,authenticationProcessingFilter,securityContextHolderAwareRequestFilter,anonymousProcessingFilter,exceptionTranslationFilter,filterInvocationInterceptor
    			</value>
    		</property>
    	</bean>
    <!-- Store SecurityContextHolder into session -->
    	<bean id="httpSessionContextIntegrationFilter" class="org.acegisecurity.context.HttpSessionContextIntegrationFilter"/>
    
    <!-- Do Logout Filter -->
    	<bean id="logoutFilter" class="org.acegisecurity.ui.logout.LogoutFilter">
    		<constructor-arg value="/index.jsp"/> <!-- URL redirected to after logout -->
    		<constructor-arg>
    			<list>
    				<!--
    				<ref bean="rememberMeServices"/>
    				-->
    				<bean class="org.acegisecurity.ui.logout.SecurityContextLogoutHandler"/>
    			</list>
    		</constructor-arg>
    	</bean>
    
       <bean id="initialDirContextFactory" class="org.acegisecurity.ldap.DefaultInitialDirContextFactory">
         <constructor-arg value="ldap://ldap.net-m.de:389/"/>
         <property name="managerDn"><value>CN=readonly,ou=ldapaccounts,ou=netm,ou=people,o=netmldap</value></property>
         <property name="managerPassword"><value>$$23-ssoU</value></property>
       </bean>
    
    
       <bean id="userSearch"
                class="org.acegisecurity.ldap.search.FilterBasedLdapUserSearch">
          <constructor-arg index="0">
            <value>ou=full,ou=accounts,ou=netm,ou=people,o=netmldap</value>
          </constructor-arg>
          <constructor-arg index="1">
            <value>(uid={0})</value>
          </constructor-arg>
          <constructor-arg index="2">
            <ref local="initialDirContextFactory" />
          </constructor-arg>            
          <property name="searchSubtree">
            <value>true</value>
          </property>            
        </bean>      
    	
    
       <bean id="ldapAuthenticationProvider" class="org.acegisecurity.providers.ldap.LdapAuthenticationProvider">
         <constructor-arg>
           <bean class="org.acegisecurity.providers.ldap.authenticator.BindAuthenticator">
              <constructor-arg><ref local="initialDirContextFactory"/></constructor-arg>
    		  <property name="userSearch" ref="userSearch"/>
           </bean>
         </constructor-arg>
         <constructor-arg>
           <bean class="org.acegisecurity.providers.ldap.populator.DefaultLdapAuthoritiesPopulator">
              <constructor-arg index="0"><ref local="initialDirContextFactory"/></constructor-arg>
              <constructor-arg index="1">
    			<value>ou=applications,ou=acl,ou=groups,ou=netm,ou=people,o=netmldap</value>
    		  </constructor-arg>
              <property name="groupRoleAttribute"><value>cn</value></property>
    		  <property name="groupSearchFilter">
    			  <value>(memberUid={1})</value>
    		  </property>
    		  <property name="searchSubtree">
    			  <value>true</value>
    		  </property>
           </bean>
         </constructor-arg>
       </bean>
    
    	<bean id="authenticationProcessingFilter" class="org.acegisecurity.ui.webapp.AuthenticationProcessingFilter">
    		<property name="authenticationManager" ref="authenticationManager"/>
    		<property name="authenticationFailureUrl" value="/login.do?login_error=1"/>
    		<property name="defaultTargetUrl" value="/"/>
    		<property name="filterProcessesUrl" value="/j_acegi_security_check"/>
    	</bean>
       
    	<bean id="securityContextHolderAwareRequestFilter" class="org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter"/>
    	<bean id="anonymousProcessingFilter" class="org.acegisecurity.providers.anonymous.AnonymousProcessingFilter">
    		<property name="key" value="changeThis"/>
    		<property name="userAttribute" value="anonymousUser,ROLE_ANONYMOUS"/>
    	</bean>
    
    	<bean id="exceptionTranslationFilter" class="org.acegisecurity.ui.ExceptionTranslationFilter">
    		<property name="authenticationEntryPoint">
    			<bean class="org.acegisecurity.ui.webapp.AuthenticationProcessingFilterEntryPoint"> <!-- Link with authenticationProcessingFilter-->
    				<property name="loginFormUrl" value="/login.do"/>
    				<property name="forceHttps" value="false"/>
    			</bean>
    		</property>
    		<property name="accessDeniedHandler">
    			<bean class="org.acegisecurity.ui.AccessDeniedHandlerImpl">
    				<property name="errorPage" value="/accessDenied.jsp"/>
    			</bean>
    		</property>
    	</bean>
    
    	<bean id="filterInvocationInterceptor" class="org.acegisecurity.intercept.web.FilterSecurityInterceptor">
    		<property name="authenticationManager" ref="authenticationManager"/>
    		<property name="accessDecisionManager">
    			<bean class="org.acegisecurity.vote.AffirmativeBased">
    				<property name="allowIfAllAbstainDecisions" value="false"/>
    				<property name="decisionVoters">
    					<list>
    						<bean class="org.acegisecurity.vote.RoleVoter"/>
    						<bean class="org.acegisecurity.vote.AuthenticatedVoter"/>
    					</list>
    				</property>
    			</bean>
    		</property>
    
    		<property name="objectDefinitionSource">
    		  <value>
    			CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
    			PATTERN_TYPE_APACHE_ANT
    			/login.do=IS_AUTHENTICATED_ANONYMOUSLY
    			/index.jsp=IS_AUTHENTICATED_ANONYMOUSLY
    			/images/**=IS_AUTHENTICATED_ANONYMOUSLY
    			/css/**=IS_AUTHENTICATED_ANONYMOUSLY
    			/j_acegi_security_check*=IS_AUTHENTICATED_ANONYMOUSLY
    			/j_acegi_logout*=IS_AUTHENTICATED_ANONYMOUSLY
    			/voicesearch.do=ROLE_DWHNETM
    			/**=IS_AUTHENTICATED_REMEMBERED
    		  </value>
    		</property>
    
    	</bean>
    
    	<!-- Processes an Authentication request.  -->
    	<bean id="authenticationManager" class="org.acegisecurity.providers.ProviderManager">
    		<!--AuthenticationProviders are tried in order until one provides a non-null response.-->
    		<property name="providers">
    			<list>
    				<ref local="ldapAuthenticationProvider"/>
    				<!--
    				<ref local="daoAuthenticationProvider"/>
    				<bean class="org.acegisecurity.providers.anonymous.AnonymousAuthenticationProvider">
    					<property name="key" value="changeThis"/>
    				</bean>
    				<bean class="org.acegisecurity.providers.rememberme.RememberMeAuthenticationProvider">
    					<property name="key" value="changeThis"/>
    				</bean>
    				-->
    			</list>
    		</property>
    	</bean>
    	<!-- This bean is optional; it isn't used by any other bean as it only listens and logs -->
    	<bean id="loggerListener" class="org.acegisecurity.event.authentication.LoggerListener"/>
    
    </beans>

    and web.xml page is:


    HTML Code:
    <filter>
    		<filter-name>Acegi Filter Chain Proxy</filter-name> 
    		<filter-class>org.acegisecurity.util.FilterToBeanProxy</filter-class>
    		<init-param> 
    			<param-name>targetClass</param-name>
    			<param-value>org.acegisecurity.util.FilterChainProxy</param-value>
    		</init-param> 
    	</filter> 
    	<filter-mapping> 
            <filter-name>Acegi Filter Chain Proxy</filter-name> 
            <url-pattern>/*</url-pattern> 
    	</filter-mapping>
    Why? I am so confused. It has same acegi configuration for spring project.

    Please help!!!

  2. #2
    Join Date
    Nov 2006
    Posts
    14

    Default

    Now I get some WARN information about it.

    HTML Code:
    2006-11-16 11:16:49,745 WARN [org.acegisecurity.event.authentication.LoggerListe
    ner] - Authentication event AuthenticationSuccessEvent: llu; details: org.acegis
    ecurity.ui.WebAuthenticationDetails@ffffc434: RemoteIpAddress: 62.214.145.200; S
    essionId: D6FECFB182D99E41878196D5281DE65C.athena-t.test.net-m.de8400
    2006-11-16 11:16:49,746 WARN [org.acegisecurity.event.authentication.LoggerListe
    ner] - Authentication event InteractiveAuthenticationSuccessEvent: llu; details:
     org.acegisecurity.ui.WebAuthenticationDetails@ffffc434: RemoteIpAddress: 62.214
    .145.200; SessionId: D6FECFB182D99E41878196D5281DE65C.athena-t.test.net-m.de8400
    2006-11-16 11:17:01,714 WARN [org.acegisecurity.event.authentication.LoggerListe
    ner] - Authentication event AuthenticationFailureBadCredentialsEvent: ; details:
     org.acegisecurity.ui.WebAuthenticationDetails@ffffc434: RemoteIpAddress: 62.214
    .145.200; SessionId: D6FECFB182D99E41878196D5281DE65C.athena-t.test.net-m.de8400
    ; exception: Empty Username
    2006-11-16 11:17:02,460 WARN [org.acegisecurity.event.authentication.LoggerListe
    ner] - Authentication event AuthenticationFailureBadCredentialsEvent: ; details:
     org.acegisecurity.ui.WebAuthenticationDetails@ffffc434: RemoteIpAddress: 62.214
    .145.200; SessionId: D6FECFB182D99E41878196D5281DE65C.athena-t.test.net-m.de8400
    ; exception: Empty Username
    2006-11-16 11:17:03,155 WARN [org.acegisecurity.event.authentication.LoggerListe
    ner] - Authentication event AuthenticationFailureBadCredentialsEvent: ; details:
     org.acegisecurity.ui.WebAuthenticationDetails@ffffc434: RemoteIpAddress: 62.214
    .145.200; SessionId: D6FECFB182D99E41878196D5281DE65C.athena-t.test.net-m.de8400
    ; exception: Empty Username
    2006-11-16 11:17:04,676 WARN [org.acegisecurity.event.authentication.LoggerListe
    ner] - Authentication event AuthenticationFailureBadCredentialsEvent: ; details:
     org.acegisecurity.ui.WebAuthenticationDetails@ffffc434: RemoteIpAddress: 62.214
    .145.200; SessionId: D6FECFB182D99E41878196D5281DE65C.athena-t.test.net-m.de8400
    ; exception: Empty Username
    Any information can get from it? Thanks

  3. #3
    Join Date
    Nov 2006
    Posts
    14

    Default

    And in server.xml there is proxyName and port there, I am not sure if it will have any infulence for the acegi.

    HTML Code:
    <Connector port="8400"
                 scheme="http"
              proxyName="net-m.proxy"
              proxyPort="80"
             maxThreads="150"
        minSpareThreads="25"
        maxSpareThreads="75"
          enableLookups="false"
           redirectPort="8123"
     acceptCount="100"
      connectionTimeout="20000"
    disableUploadTimeout="true"
                  debug="0" />
    Hope this can help

  4. #4
    Join Date
    Sep 2006
    Location
    UK
    Posts
    8,424

    Default

    So your saying your application works fine locally but when you host it somewhere else it doesn't? I think this might just be a general configuration issue. Have you tried just trying to host a simple web page there and accessing that with the same configuration setup?

  5. #5
    Join Date
    Nov 2006
    Posts
    14

    Default

    Thanks karldmoore

    I found what's the problem.
    It's caused by proxy configuration on <connector ...> just I described above.

    But I still don't know why proxy will cause the issue for acegi security.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •