`
chxiaowu
  • 浏览: 241160 次
  • 性别: Icon_minigender_1
  • 来自: 武汉
社区版块
存档分类
最新评论

Error creating bean with name '_filterChainProxy' || Error creating bean with

 
阅读更多
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)
 
06:19-[org.springframework.web.context.ContextLoader]-[ERROR] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'locationListener' defined in file [D:\workspace_drools\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\middleware-collector\WEB-INF\classes\applicationContext-collector.xml]: Cannot resolve reference to bean 'collectorService' while setting bean property 'collectorService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'collectorService' defined in file [D:\workspace_drools\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\middleware-collector\WEB-INF\classes\applicationContext.xml]: Cannot resolve reference to bean 'collectorDao' while setting bean property 'collectorDao'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'collectorDao' defined in file [D:\workspace_drools\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\middleware-collector\WEB-INF\classes\applicationContext.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in file [D:\workspace_drools\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\middleware-collector\WEB-INF\classes\applicationContext.xml]: Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'alarmRecordListener' defined in file [D:\workspace_drools\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\middleware-collector\WEB-INF\classes\applicationContext-collector.xml]: Cannot resolve reference to bean 'alarminfoService' while setting bean property 'alarminfoService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'alarminfoService' defined in file [D:\workspace_drools\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\middleware-collector\WEB-INF\classes\applicationContext.xml]: Cannot resolve reference to bean 'alarminfoDao' while setting bean property 'alarminfoDao'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'alarminfoDao' defined in file [D:\workspace_drools\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\middleware-collector\WEB-INF\classes\applicationContext.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'sessionFactory': FactoryBean which is currently in creation returned null from getObject


	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)
	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
	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:222)
	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.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:254)
	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:728)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
	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:4723)
	at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5226)
	at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5221)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
	at java.lang.Thread.run(Thread.java:619)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'collectorService' defined in file [D:\workspace_drools\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\middleware-collector\WEB-INF\classes\applicationContext.xml]: Cannot resolve reference to bean 'collectorDao' while setting bean property 'collectorDao'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'collectorDao' defined in file [D:\workspace_drools\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\middleware-collector\WEB-INF\classes\applicationContext.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in file [D:\workspace_drools\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\middleware-collector\WEB-INF\classes\applicationContext.xml]: Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'alarmRecordListener' defined in file [D:\workspace_drools\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\middleware-collector\WEB-INF\classes\applicationContext-collector.xml]: Cannot resolve reference to bean 'alarminfoService' while setting bean property 'alarminfoService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'alarminfoService' defined in file [D:\workspace_drools\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\middleware-collector\WEB-INF\classes\applicationContext.xml]: Cannot resolve reference to bean 'alarminfoDao' while setting bean property 'alarminfoDao'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'alarminfoDao' defined in file [D:\workspace_drools\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\middleware-collector\WEB-INF\classes\applicationContext.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'sessionFactory': FactoryBean which is currently in creation returned null from getObject
	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)
	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
	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:222)
	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.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:269)
	... 29 more
 

 

报这2个错误,有可能是你使用了 Spring Security,请把配置中 auto-config="true" 去掉试试。

 

<http auto-config='true'><!-- auto-config='true' -->
        <concurrent-session-control max-sessions="10" exception-if-maximum-exceeded="true" />
        <logout logout-url="/j_spring_security_logout"/>
        <intercept-url pattern="/main.jsp" access="IS_AUTHENTICATED_FULLY"/><!--登录用户有权访问-->
        <intercept-url pattern="/main/*" access="IS_AUTHENTICATED_FULLY"/>
        <form-login login-page="/login.jsp" authentication-failure-url="/login.jsp"  default-target-url="/main.jsp" />
	</http>

 

报错信息有可能是以下2种方式:

 

1、Error creating bean with name '_filterChainProxy'

 

2、Error creating bean with name 'sessionFactory': FactoryBean which is currently in creation returned null from getObject

0
0
分享到:
评论

相关推荐

    acegi认证,授权

    &lt;bean id="filterChainProxy" class="org.acegisecurity.util.FilterChainProxy"&gt; &lt;property name="filterInvocationDefinitionSource"&gt; PATTERN_TYPE_APACHE_ANT /**=...

    Acegi配置指南

    &lt;param-name&gt;targetBean&lt;/param-name&gt; &lt;param-value&gt;filterChainProxy &lt;filter-name&gt;Acegi Filter Chain Proxy&lt;/filter-name&gt; &lt;url-pattern&gt;/* ``` 在上述配置中,`FilterToBeanProxy`类用于将过滤器实例...

    acegi在spring中的完整配置

    &lt;bean id="filterChainProxy" class="org.acegisecurity.util.FilterChainProxy"&gt; &lt;property name="filterInvocationDefinitionSource"&gt; CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON PATTERN_TYPE_APACHE_ANT ...

    Acegi(十三): 让系统记住我

    &lt;bean id="filterChainProxy" class="org.acegisecurity.util.FilterChainProxy"&gt; &lt;property name="filterInvocationDefinitionSource"&gt; CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON PATTERN_TYPE_APACHE_ANT...

    挑战Acegi1.0

    `filterChainProxy` Bean是Acegi1.0的核心,通过它定义了一组过滤器,这些过滤器按顺序被调用来处理每一个请求。 #### 四、总结 通过以上配置,我们可以看到Acegi1.0提供了非常灵活和强大的安全性管理机制。开发者...

    acegi 使用说明

    &lt;bean id="filterChainProxy" class="org.acegisecurity.util.FilterChainProxy"&gt; **"&gt; &lt;/bean&gt; ``` 在这个例子中,所有请求都将经过这四个过滤器。 在Acegi的配置中,还有其他重要概念,如访问决策管理...

    Spring Security 3连接数据库查询实例

    首先,我们看到配置文件中的 `&lt;bean id="filterChainProxy"`,这是Spring Security的核心组件之一,它负责定义过滤器链。`FilterChainProxy` 类根据配置的规则决定哪些请求应该通过哪个过滤器。`...

    学习Acegi-认证 文档

    &lt;bean id="filterChainProxy" class="org.acegisecurity.ui.rememberme.PersistentTokenBasedRememberMeServices"&gt; &lt;property name="key" value="myAppKey"/&gt; &lt;property name="tokenRepository" ref=...

    Acegi入门资料

    - 示例配置:通过`&lt;bean&gt;`标签定义了`filterChainProxy` Bean,并通过`&lt;property&gt;`标签指定过滤链的定义源。 - **httpSessionContextIntegrationFilter**:此Filter用于在每次请求前从Session中获取`...

    spring过滤器大全 代码

    FilterChainProxy会按顺序来调用这些filter,使这些filter能享用Spring Ioc的功能, CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON 定义url比较前先转为小写 PATTERN_TYPE_APACHE_ANT 定义使用Apache ant的匹配模式

    3.springSecurity源码分析1

    在web.xml中,filter-name设置为"springSecurityFilterChain"的原因在于,SpringSecurity的配置约定是将核心过滤器链的bean命名为"springSecurityFilterChain"。DelegatingFilterProxy在初始化时会尝试找到这个bean...

    acegi源码解读.txtacegi源码解读.txtacegi源码解读.txt

    如果`targetClass`为`FilterChainProxy.class`,那么Spring将获取名为`delegate`的bean,该bean实际是安全过滤器链的代理,负责执行一系列的安全检查。 ##### 3. pattern匹配与Filter链转换 在处理web请求时,`...

    Acegi配置指南[整理].pdf

    `init-param` 的 `targetBean` 参数指定了要查找的 Spring Bean 名,即 `filterChainProxy`,这样 Acegi 就可以通过 Spring 的依赖注入来管理这个过滤器,确保了正确的初始化和销毁。 `lazy` 和 `lifecycle` 是两个...

    acegi学习指南以及例子

    Acegi的核心组件包括SecurityContext、Authentication、Authorization和FilterChainProxy。SecurityContext存储了当前用户的认证信息,Authentication代表了用户的身份和权限,Authorization则是处理访问控制的部分...

    Acegi 各过滤的解析(二)

    &lt;bean id="filterChainProxy" class="org.acegisecurity.util.FilterChainProxy"&gt; *" filters="none"/&gt; **" filters="channel-processing-filter, security-context-persistence-filter, concurrent-session-...

    Shiro权限控制-区分Ajax请求

    &lt;bean id="shiroFilter" class="org.apache.shiro.web.filter.mgt.FilterChainProxy"&gt; &lt;property name="filterChainDefinitionMap"&gt; &lt;!-- 配置过滤器 --&gt; **" value="anon"/&gt; **" value="anon"/&gt; **" value=...

    spring安全框架3.2

    `DelegatingFilterProxy`的作用是将过滤器的工作转交给Spring管理的Bean,通常是`FilterChainProxy`。 2. **FilterChainProxy**: `FilterChainProxy`是Spring Security的核心组件之一,负责构建和执行过滤链。在...

    SSH和SSI等框架常用基础配置web.xml

    &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt; classpath*:/config/framework/*.xml, classpath*:/config/app/*.xml ``` **解析**:这段配置指定了Spring框架读取配置文件的位置。通过`...

    Spring 各种过滤器配置大全

    FilterChainProxy会按顺序来调用这些filter,使这些filter能享用Spring Ioc的功能, CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON 定义url比较前先转为小写 PATTERN_TYPE_APACHE_ANT 定义使用Apache ant的匹配模式

Global site tag (gtag.js) - Google Analytics