Hello,
I tried following
https://cwiki.apache.org/WICKET/spring-security-and-wicket-auth-roles.htmlto
setup spring security 3.0 and wicket auth roles in my application and
I
ran into a few problems that I was wondering if anyone else had seen. I am
currently getting a java.lang.IllegalStateException: bean of type
[org.springframework.security.authentication.AuthenticationManager] not
found. Below is my web.xml, security xml file and a snippet of where the
class is being called. Thanks for the help
[web.xml]
.........
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:/app-context/springApplicationContext.xml</param-value>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:/app-context/applicationContext-security.xml</param-value>
</context-param>
...........
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
[applicationContext-security.xml]
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:security="http://www.springframework.org/schema/security"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-3.0.xsd"
>
<!-- security -->
<security:http create-session="never" auto-config="true" >
<security:remember-me/>
<security:intercept-url pattern="/**"/>
</security:http>
<security:authentication-manager alias="authenticationManager">
<security:authentication-provider>
<!-- TODO change this to reference our real user service -->
<security:user-service>
<security:user name="admin" password="admin"
authorities="ROLE_ADMIN, ROLE_USER" />
<security:user name="user" password="user"
authorities="ROLE_USER" />
</security:user-service>
</security:authentication-provider>
</security:authentication-manager>
<security:global-method-security secured-annotations="enabled" />
</beans>
[MySession.java]
@SpringBean
private AuthenticationManager authenticationManager;
public MySession()
{
super(request);
injectDependencies();
ensureDependenciesNotNull();
}
private void injectDependencies()
{
InjectorHolder.getInjector().inject(this); //When this method is
tried the IllegalStateException error is thrown.
}
--
Eric Reagan