Kent Larsson (Migrated from SEC-1162) said:
When using Spring Security using makes it possible to reference the AuthenticationManager used with the id foo. However this is not noticed by Spring IDE which adds a warning of the form: Referenced bean 'foo' not found
It should be noted that the code works when it's run. See Spring Forum thread for more details.
Kent Larsson said:
I didn't know which Component this issue relates to, please change it into the proper one.
Christian Dupuis said:
Luke, this is a problem in AuthenticationManagerBeanDefinitionParser not using the Tooling API to register the authenticationManager bean and the alias.
Luke Taylor said:
I've made an attempt at fixing this issue by registering a BeanComponentDefintion for the AuthenticationManager, but I've had some problems.
Firstly, I couldn't get the AuthenticationManager bean instance to appear in Spring IDE unless I explicitly declare a "source" object. Could you confirm whether Spring IDE will show beans which do not have a source property? The AuthenticationManager is registered internally by the namespace, so it doesn't really make sense for it to be attached to a specific HTML element.
I managed to get the alias to appear (and the error to go away) by using the method:
pc.getReaderContext().fireAliasRegistered(BeanIds.AUTHENTICATION_MANAGER, alias, pc.extractSource(element));
after registering the alias using
Is that the correct approach? The alias just appears as a little bean icon with a square round it and the alias name next to it. There is no indication of what it actually aliases. The warning in the XML editor only goes away when the AuthenticationMananger bean is visible, so I would like to find a better solution for that, other than giving it a source object.
I spoke with Christian some time ago and this is the correct expected. With a Spring IDE build using the latest namespace code, the alias now appears and there are no errors.