Spring Security
  1. Spring Security
  2. SEC-1885

Adding <debug/> causes NoSuchMethodException when FilterChainProxy's relies on beans that have Autowired Constructors

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Complete
    • Affects Version/s: 3.1.0
    • Fix Version/s: 3.1.1
    • Component/s: Namespace
    • Labels:
      None

      Description

      An example would be if a configuration used <debug/> and a custom AuthenticationProvider or UserDetailsService which had an Autowired constructor one might get an exception similar to NoSuchMethodException MyCustomAuthenticationProvider.<init>()

        Issue Links

          Activity

          Hide
          Rob Winch added a comment -

          This was happening because SecurityDebugBeanFactoryPostProcessor looked up the FilterChainProxy from the ApplicationContext which attempted to resolve all of the FilterChainProxy's dependent beans. This occurred before the AutowiredAnnotationBeanPostProcessor was registered causing the Exception. The SecurityDebugBeanFactoryPostProcessor now only interacts with BeanDefinition's to prevent this from happening

          Show
          Rob Winch added a comment - This was happening because SecurityDebugBeanFactoryPostProcessor looked up the FilterChainProxy from the ApplicationContext which attempted to resolve all of the FilterChainProxy's dependent beans. This occurred before the AutowiredAnnotationBeanPostProcessor was registered causing the Exception. The SecurityDebugBeanFactoryPostProcessor now only interacts with BeanDefinition's to prevent this from happening

            People

            • Assignee:
              Rob Winch
              Reporter:
              Rob Winch
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: