我尝试了以下方法:
<bean id="authenticationManager" class="org.springframework.security.authentication.ProviderManager">
<property name="providers">
<list>
<ref local="myAuthnProvider"/>
</list>
</property>
<property name="authenticationEventPublisher">
<bean class="myPublisher/>
</property>
</bean>
<security:authentication-manager>
<security:authentication-provider ref="authenticationManager" />
</security:authentication-manager>
但是我在启动过程中遇到了异常。我还尝试了构造函数标记,结果相同:
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.authenticationManager': Could not resolve matching constructor (hint: secify index/type/name arguments for simple parameters to avoid type ambiguities)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:250)
我正在使用弹簧 3.1.1。
任何想法为什么会引发此错误?或有关如何捕获身份验证事件的其他建议?谢谢。