Announcement Announcement Module
Collapse
No announcement yet.
Error finding filterChains bean Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error finding filterChains bean

    I'm getting this error when I add <oauth:client/> to my config file. Struggling to figure out why or where to even begin troubleshooting.

    Code:
    16:23:24,934 ERROR [[/suite]] Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
    org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from ServletContext resource [/WEB-INF/conf/security/spring-security-08-oauth.xml]; nested exception is org.springframework.beans.factory.
    NoSuchBeanDefinitionException: No bean named org.springframework.security.filterChains' is defined

  • #2
    What version of the library are you using? What version of spring security? Can you post the full stacktrace?

    Comment


    • #3
      Spring Security - 3.1.0.M1
      Spring Security OAuth - 1.0.0.BUILD-SNAPSHOT with the lastest master branch code

      Full stacktrace is attached.

      Comment


      • #4
        Looks like you don't have a filter chain defined. SSOAuth needs a filter chain to injects itself into. Are you using the standard <http> element in the spring security namespace configuration?

        Comment


        • #5
          Yes, I am using <http> element.

          I swapped out the Spring Security 3.1.0.M1 jars for RC2 jars and the NoSuchBeanDefinition exception went away. However, I ended up with an exception that the OAuth 2 context had not been set the first time I tried to access a protected resource.

          Comment


          • #6
            Hmm... they must have changed the bean name between M1 and M2.

            You might be able to get around that by using aliasing the M1 name to the M2 name.

            Comment


            • #7
              Looking at the Spring Security source - it looks like the BeanIds.FILTER_CHAINS used here wasn't introduced until RC2.

              Comment


              • #8
                Does an alias work?

                Code:
                <beans:alias name="name_of_filter_change_in_rc1" alias="org.springframework.security.filterChains"/>

                Comment


                • #9
                  From what I can tell - there wasn't one from M1 to RC1 so, I don't even know what I would alias to.

                  Comment


                  • #10
                    My issues with not finding the filterChains bean have gone away since changing to RC2 but, I'm getting this message "No OAuth 2 security context has been established." the first time I try to use a RestTemplate. I was expecting it to kick me out to the Facebook login instead.

                    I thought adding <oauth:client/> would be enough but that doesn't seem to be the case. Am I missing something else?

                    Comment

                    Working...
                    X