Bonjour.
J'ai une classe org.acegisecurity.ui.logout.LogoutFilter qui réclame à la création 2 paramètres :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
 
LogoutFilter(String logoutSuccessUrl, LogoutHandler[] handlers)
Dans mon fichier applicationContext.xml je déclare mon bean de la façon suivante :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
 
	<bean id="logoutFilter" class="org.acegisecurity.ui.logout.LogoutFilter">
		<constructor-arg>
			<value>/logoff.action</value>
		</constructor-arg>
		<constructor-arg>
			<list>
				<ref bean="securityContextLogoutHandler"/>
			</list>
		</constructor-arg>
	</bean>
	<bean id="securityContextLogoutHandler" class="org.acegisecurity.ui.logout.SecurityContextLogoutHandler">
		<property name="invalidateHttpSession">
			<value>true</value>
		</property>
	</bean>
Mais lors de la création du bean logoutFilter, j'ai l'erreur suivante :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
 
18:20:50,671 DEBUG DefaultListableBeanFactory:151 - Ignoring constructor [public org.acegisecurity.ui.logout.LogoutFilter(java.lang.String,org.acegisecurity.ui.logout.LogoutHandler[])] of bean 'logoutFilter': org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'logoutFilter' defined in ServletContext resource [/WEB-INF/applicationContext-security.xml]: Unsatisfied dependency expressed through constructor argument with index 1 of type [org.acegisecurity.ui.logout.LogoutHandler[]]: There are 0 beans of type [[Lorg.acegisecurity.ui.logout.LogoutHandler;] available for autowiring: []. There should have been exactly 1 to be able to autowire constructor of bean 'logoutFilter'.
18:20:50,671  INFO DefaultListableBeanFactory:274 - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@bb1ee: defining beans [entDataSource,filterChainProxy,channelProcessingFilter,channelDecisionManager,secureChannelProcessor,insecureChannelProcessor,logoutFilter,securityContextLogoutHandler,sessionRegistry,concurrentSessionController,concurrentSessionFilter,httpSessionContextIntegrationFilter,authenticationProcessingFilter,authenticationManager,authenticationProvider,filterSecurityInterceptor,accessDecisionManager,roleVoter,userDetailsService,jdbcDaoImpl]; root of factory hierarchy
18:20:50,671 ERROR ContextLoader:200 - Context initialization failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'logoutFilter' defined in ServletContext resource [/WEB-INF/applicationContext-security.xml]: Unsatisfied dependency expressed through constructor argument with index 1 of type [org.acegisecurity.ui.logout.LogoutHandler[]]: There are 0 beans of type [[Lorg.acegisecurity.ui.logout.LogoutHandler;] available for autowiring: []. There should have been exactly 1 to be able to autowire constructor of bean 'logoutFilter'.
	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:458)
	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:140)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:773)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:716)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:386)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:144)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:279)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:360)
	at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:241)
	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)
	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4336)
	at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1105)
	at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1203)
	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
	at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1307)
	at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1571)
	at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1580)
	at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1560)
	at java.lang.Thread.run(Unknown Source)
8 juin 2007 18:20:50 org.apache.catalina.core.StandardContext listenerStart
GRAVE: Exception lors de l'envoi de l'évènement contexte initialisé (context initialized) à l'instance de classe d'écoute (listener) org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'logoutFilter' defined in ServletContext resource [/WEB-INF/applicationContext-security.xml]: Unsatisfied dependency expressed through constructor argument with index 1 of type [org.acegisecurity.ui.logout.LogoutHandler[]]: There are 0 beans of type [[Lorg.acegisecurity.ui.logout.LogoutHandler;] available for autowiring: []. There should have been exactly 1 to be able to autowire constructor of bean 'logoutFilter'.
	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:458)
	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:140)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:773)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:716)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:386)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:144)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:279)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:360)
	at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:241)
	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)
	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4336)
	at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1105)
	at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1203)
	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
	at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1307)
	at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1571)
	at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1580)
	at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1560)
	at java.lang.Thread.run(Unknown Source)
Est-ce un problème d'autowiring ?
Je ne sais pas comment résoudre ce problème
Pouvez-vous m'aider SVP ?

PPDL.