Results 1 to 10 of 11

Thread: Websphere 7 - universal match pattern ('/**') is defined before other patterns

Threaded View

  1. #1
    Join Date
    Dec 2011
    Posts
    14

    Default Websphere 7 - universal match pattern ('/**') is defined before other patterns

    I have generated a spring project using Roo, and used the security setup addon to add in the spring security. The security works fine on Tomcat 7, but am running into the following problem when trying to deploy to Websphere 7.0.0.19. I'm currently using Spring Security 3.1.0.RELEASE. I've seen other projects use the Spring DelegatingFilterProxy just fine within Websphere. Anybody have any ideas?

    Error from StackTrace:
    Code:
    E org.springframework.web.context.ContextLoader initWebApplicationContext Context initialization failed
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.filterChainProxy': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: A universal match pattern ('/**') is defined  before other patterns in the filter chain, causing them to be ignored. Please check the ordering in your <security:http> namespace or FilterChainProxy bean configuration
    applicationContext-security.xml
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans:beans xmlns="http://www.springframework.org/schema/security" 
        xmlns:beans="http://www.springframework.org/schema/beans" 
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
            http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd"> 
    
        <!-- HTTP security configurations -->
        <http auto-config="true" use-expressions="true" >
            <form-login login-processing-url="/resources/j_spring_security_check" login-page="/login" authentication-failure-url="/login?login_error=t" />
            <logout logout-url="/resources/j_spring_security_logout" />
            <!-- Configure these elements to secure URIs in your application -->
            <intercept-url pattern="/login" access="permitAll" />
            <intercept-url pattern="/admin/**" access="hasRole('ROLE_ADMIN')" />
            <intercept-url pattern="/jobtypes/**" access="isAuthenticated()" />
            <intercept-url pattern="/tests/**" access="permitAll" />
            <!-- Websphere Problem: IllegalArgumentException: A universal match pattern ('/**') is defined  before other patterns in the filter chain -->
            <intercept-url pattern="/resources/**" access="permitAll" />
            <intercept-url pattern="/**" access="hasRole('ROLE_USER')" />
        </http>
        
        <!-- Configure Authentication mechanism -->
    	<beans:bean name="myCompanyAuthenticationProvider" class="edu.mycompany.project.security.MyCompanyAuthenticationProvider" />
    	<authentication-manager alias="authenticationManager">
    		<authentication-provider ref="myCompanyAuthenticationProvider" />
    	</authentication-manager>   
    </beans:beans>

    UPDATE:

    I have confirmed the security config is getting loaded twice. I have uploaded my web.xml

    Still not exactly sure why it is loading twice though. Will work in the forums on this. Thanks!
    Attached Files Attached Files
    Last edited by iojohnso; Aug 17th, 2012 at 12:31 PM. Reason: Confirmed security config is getting loaded twice

Tags for this Thread

Posting Permissions

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