Results 1 to 3 of 3

Thread: spring security 3.1 not support profile in spring3.1?

  1. #1

    Default spring security 3.1 not support profile in spring3.1?

    hi,All:
    I know spring security 3.1 using spring3.0.7, I try to upgrade to spring3.1 because I need profile in spring3.1.
    if I want http channel in develop and https in release :
    Code:
       <beans:beans profile="dev,default">
        <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" default-target-url='/'/>
            <logout logout-url="/resources/j_spring_security_logout" />
            <!-- Configure these elements to secure URIs in your application -->
            <intercept-url pattern="/admin/**" access="permitAll" requires-channel="http"/>  
    
           .....
        </beans:beans>
        <beans:beans profile="release">
        <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" default-target-url='/'/>
            <logout logout-url="/resources/j_spring_security_logout" />
            
            <intercept-url pattern="/admin/**" access="hasRole('ROLE_ADMIN')" requires-channel="https"/>
    I meet this error:

    Code:
       2012-07-23 16:30:00.899:WARN:oejuc.AbstractLifeCycle:FAILED springSecurityFilterChain: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'springSecurityFilterChain' is defined
    org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'springSecurityFilterChain' is defined
    when security will upgrade to spring3.1?

  2. #2
    Join Date
    Jan 2008
    Posts
    1,826

    Default

    Spring Security requires at least Spring 3.0.6, but it can supports Spring 3.1.x as well. Ensure that one of your profiles is active. You can see which profiles are being used by enabling debug logging for org.springframework.web.context.support.StandardSe rvletEnvironment.
    Rob Winch - @rob_winch
    Spring Security Lead
    Pivotal

  3. #3

    Default

    thank you very much!
    I have found the reason after enable debug logging for org.springframework.web.context.support.StandardSe rvletEnvironment

    my origin web.xml is
    Code:
    <context-param>
            <param-name>spring.profiles.active</param-name>  
            <param-value>${profiles.active}</param-value>
    </context-param>
    I start jetty from maven, so I need to change the plugin configuration to make jetty plugin find the replaced properties
    Code:
    <webXml>${project.build.directory}/${project.build.finalName}/WEB-INF/web.xml</webXml>
    and now it is working

Posting Permissions

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