Announcement Announcement Module
Collapse
No announcement yet.
Error creating bean with name '_filterChainProxy' Page Title Module
Move Remove Collapse
This topic is closed
X
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error creating bean with name '_filterChainProxy'

    I'm trying to add the Spring Security configuration into my web app and I'm getting the following error...

    Code:
    ERROR: 20:54:44: org.springframework.web.context.ContextLoader: Context initialization failed
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_filterChainProxy': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_filterChainList': Cannot resolve reference to bean '_rememberMeFilter' while setting bean property 'filters' with key [6]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_rememberMeFilter': Cannot resolve reference to bean '_rememberMeServices' while setting bean property 'rememberMeServices'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_rememberMeServices': Initialization of bean failed; nested exception is org.springframework.security.config.SecurityConfigurationException: More than one UserDetailsService registered. Please use a specific Id in your configuration
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:478)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
    	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
    	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:220)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
    	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381)
    	at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
    	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
    	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
    	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)
    	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4334)
    	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
    	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
    	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
    	at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)
    	at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
    	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
    	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
    	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
    	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
    	at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    	at org.apache.catalina.core.StandardService.start(StandardService.java:516)
    	at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    	at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.lang.reflect.Method.invoke(Unknown Source)
    	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
    	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
    The web app has...
    * ZK web GUI front end
    * Spring business tier
    * Hibernate persistence

    Any ideas??

    Here are the related config files.

    First, 'web.xml' ...
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app id="skap" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    
    	<display-name>skap</display-name>
    
    	<filter>
    		<filter-name>springSecurityFilterChain</filter-name>
    		<filter-class>
    			org.springframework.web.filter.DelegatingFilterProxy
    		</filter-class>
    	</filter>
    
    	<listener>
    		<listener-class>
    			org.springframework.security.ui.session.HttpSessionEventPublisher
    		</listener-class>
    	</listener>
    
    	<filter-mapping>
    		<filter-name>springSecurityFilterChain</filter-name>
    		<url-pattern>/*</url-pattern>
    	</filter-mapping>
    
    	<context-param>
    		<param-name>contextConfigLocation</param-name>
    		<param-value>
    			/WEB-INF/classes/applicationContext.xml,/WEB-INF/classes/authenticationContext.xml
    		</param-value>
    	</context-param>
    
    	<listener>
    		<listener-class>
    			org.springframework.web.context.ContextLoaderListener
    		</listener-class>
    	</listener>
    
    	<listener>
    		<listener-class>
    			org.springframework.web.context.request.RequestContextListener</listener-class>
    	</listener>
    
    
    	<listener>
    		<description>
    			Used to cleanup when a session is destroyed
    		</description>
    		<display-name>ZK Session Cleaner</display-name>
    		<listener-class>
    			org.zkoss.zk.ui.http.HttpSessionListener
    		</listener-class>
    	</listener>
    
    
    	<servlet>
    		<description>The servlet loads the DSP pages.</description>
    		<servlet-name>dspLoader</servlet-name>
    		<servlet-class>
    			org.zkoss.web.servlet.dsp.InterpreterServlet
    		</servlet-class>
    	</servlet>
    	<servlet>
    		<description>ZK loader for ZUML pages</description>
    		<servlet-name>zkLoader</servlet-name>
    		<servlet-class>
    			org.zkoss.zk.ui.http.DHtmlLayoutServlet
    		</servlet-class>
    		<init-param>
    			<param-name>update-uri</param-name>
    			<param-value>/zkau</param-value>
    		</init-param>
    		<load-on-startup>1</load-on-startup>
    	</servlet>
    	<servlet>
    		<description>The asynchronous update engine for ZK</description>
    		<servlet-name>auEngine</servlet-name>
    		<servlet-class>
    			org.zkoss.zk.au.http.DHtmlUpdateServlet
    		</servlet-class>
    	</servlet>
    	<servlet-mapping>
    		<servlet-name>dspLoader</servlet-name>
    		<url-pattern>*.dsp</url-pattern>
    	</servlet-mapping>
    	<servlet-mapping>
    		<servlet-name>zkLoader</servlet-name>
    		<url-pattern>*.zul</url-pattern>
    	</servlet-mapping>
    	<servlet-mapping>
    		<servlet-name>zkLoader</servlet-name>
    		<url-pattern>*.zhtml</url-pattern>
    	</servlet-mapping>
    	<servlet-mapping>
    		<servlet-name>auEngine</servlet-name>
    		<url-pattern>/zkau/*</url-pattern>
    	</servlet-mapping>
    	<welcome-file-list>
    		<welcome-file>index.html</welcome-file>
    		<welcome-file>index.htm</welcome-file>
    		<welcome-file>index.jsp</welcome-file>
    		<welcome-file>default.html</welcome-file>
    		<welcome-file>default.htm</welcome-file>
    		<welcome-file>default.jsp</welcome-file>
    		<welcome-file>index.zul</welcome-file>
    	</welcome-file-list>
    </web-app>
    Now the spring authentication relate config file...
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    
    <beans:beans xmlns="http://www.springframework.org/schema/security"
        xmlns:beans="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.springframework.org/schema/beans 
            http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
            http://www.springframework.org/schema/security 
            http://www.springframework.org/schema/security/spring-security-2.0.1.xsd">
    
        <http auto-config="true">
           <intercept-url pattern="/**" access="IS_AUTHENTICATED_ANONYMOUSLY"/> 
           <anonymous username="guest" granted-authority="ROLE_GUEST"/>
           <http-basic/>
        </http>
        
        <authentication-provider >
          <user-service>
             <user name="ich" password="ich" authorities="ROLE_USER"/>
             <user name="admin" password="admin" authorities="ROLE_ADMIN"/>
          </user-service>
        </authentication-provider>
        
    </beans:beans>

  • #2
    Found the answer...

    If I remove auto-config="true" from the http tag in the Spring Security config file then it now works OK.

    Comment


    • #3
      me too

      i hava the same problem,thx!

      Comment

      Working...
      X