tomcat启动报错:Bean name 'XXX' is already used in this <beans> element
如题,tomcat容器启动时加载spring的bean,结果报错如下:
- 六月 28, 2017 9:02:25 上午 org.apache.tomcat.util.digester.SetPropertiesRule begin
- 警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:ms-selection' did not find a matching property.
- 六月 28, 2017 9:02:25 上午 org.apache.catalina.startup.VersionLoggerListener log
- 信息: Server version: Apache Tomcat/8.5.13
- 六月 28, 2017 9:02:25 上午 org.apache.catalina.startup.VersionLoggerListener log
- 信息: Server built: Mar 27 2017 14:25:04 UTC
- 六月 28, 2017 9:02:25 上午 org.apache.catalina.startup.VersionLoggerListener log
- 信息: Server number: 8.5.13.0
- 六月 28, 2017 9:02:25 上午 org.apache.catalina.startup.VersionLoggerListener log
- 信息: OS Name: Windows 7
- 六月 28, 2017 9:02:25 上午 org.apache.catalina.startup.VersionLoggerListener log
- 信息: OS Version: 6.1
- 六月 28, 2017 9:02:25 上午 org.apache.catalina.startup.VersionLoggerListener log
- 信息: Architecture: amd64
- 六月 28, 2017 9:02:25 上午 org.apache.catalina.startup.VersionLoggerListener log
- 信息: Java Home: D:\wulinfeng\Java\jdk1.8.0_131\jre
- 六月 28, 2017 9:02:25 上午 org.apache.catalina.startup.VersionLoggerListener log
- 信息: JVM Version: 1.8.0_131-b11
- 六月 28, 2017 9:02:25 上午 org.apache.catalina.startup.VersionLoggerListener log
- 信息: JVM Vendor: Oracle Corporation
- 六月 28, 2017 9:02:25 上午 org.apache.catalina.startup.VersionLoggerListener log
- 信息: CATALINA_BASE: E:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
- 六月 28, 2017 9:02:25 上午 org.apache.catalina.startup.VersionLoggerListener log
- 信息: CATALINA_HOME: D:\wulinfeng\tomcat\apache-tomcat-8.5.13
- 六月 28, 2017 9:02:25 上午 org.apache.catalina.startup.VersionLoggerListener log
- 信息: Command line argument: -agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:55079
- 六月 28, 2017 9:02:25 上午 org.apache.catalina.startup.VersionLoggerListener log
- 信息: Command line argument: -Dcatalina.base=E:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
- 六月 28, 2017 9:02:25 上午 org.apache.catalina.startup.VersionLoggerListener log
- 信息: Command line argument: -Dcatalina.home=D:\wulinfeng\tomcat\apache-tomcat-8.5.13
- 六月 28, 2017 9:02:25 上午 org.apache.catalina.startup.VersionLoggerListener log
- 信息: Command line argument: -Dwtp.deploy=E:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps
- 六月 28, 2017 9:02:25 上午 org.apache.catalina.startup.VersionLoggerListener log
- 信息: Command line argument: -Djava.endorsed.dirs=D:\wulinfeng\tomcat\apache-tomcat-8.5.13\endorsed
- 六月 28, 2017 9:02:25 上午 org.apache.catalina.startup.VersionLoggerListener log
- 信息: Command line argument: -Dfile.encoding=UTF-8
- 六月 28, 2017 9:02:25 上午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
- 信息: Loaded APR based Apache Tomcat Native library 1.2.12 using APR version 1.5.2.
- 六月 28, 2017 9:02:25 上午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
- 信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
- 六月 28, 2017 9:02:25 上午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
- 信息: APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
- 六月 28, 2017 9:02:26 上午 org.apache.catalina.core.AprLifecycleListener initializeSSL
- 信息: OpenSSL successfully initialized (OpenSSL 1.0.2k 26 Jan 2017)
- 六月 28, 2017 9:02:26 上午 org.apache.coyote.AbstractProtocol init
- 信息: Initializing ProtocolHandler ["http-nio-9090"]
- 六月 28, 2017 9:02:27 上午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
- 信息: Using a shared selector for servlet write/read
- 六月 28, 2017 9:02:27 上午 org.apache.coyote.AbstractProtocol init
- 信息: Initializing ProtocolHandler ["ajp-nio-8009"]
- 六月 28, 2017 9:02:27 上午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
- 信息: Using a shared selector for servlet write/read
- 六月 28, 2017 9:02:27 上午 org.apache.catalina.startup.Catalina load
- 信息: Initialization processed in 2954 ms
- 六月 28, 2017 9:02:27 上午 org.apache.catalina.core.StandardService startInternal
- 信息: Starting service Catalina
- 六月 28, 2017 9:02:27 上午 org.apache.catalina.core.StandardEngine startInternal
- 信息: Starting Servlet Engine: Apache Tomcat/8.5.13
- 六月 28, 2017 9:02:34 上午 org.apache.jasper.servlet.TldScanner scanJars
- 信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
- 六月 28, 2017 9:02:34 上午 org.apache.catalina.core.ApplicationContext log
- 信息: No Spring WebApplicationInitializer types detected on classpath
- 六月 28, 2017 9:02:36 上午 org.apache.catalina.core.ApplicationContext log
- 信息: Initializing Spring root WebApplicationContext
- 六月 28, 2017 9:02:38 上午 org.apache.catalina.core.StandardContext listenerStart
- 严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
- org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from relative location [microservice.xml]
- Offending resource: class path resource [spring-core.xml]; nested exception is org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Bean name 'ms.selection.abetOrOpposePostService' is already used in this <beans> element
- Offending resource: class path resource [microservice.xml]
- at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:70)
- at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
- at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:76)
- at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:255)
- at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseDefaultElement(DefaultBeanDefinitionDocumentReader.java:180)
- at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:165)
- at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:138)
- at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:94)
- at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:508)
- at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:392)
- at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)
- at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304)
- at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:181)
- at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:217)
- at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:188)
- at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)
- at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
- at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129)
- at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:612)
- at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:513)
- at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:444)
- at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:326)
- at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
- at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4745)
- at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5207)
- at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
- at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419)
- at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
- at java.util.concurrent.FutureTask.run(FutureTask.java:266)
- at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
- at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
- at java.lang.Thread.run(Thread.java:748)
- Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Bean name 'ms.selection.abetOrOpposePostService' is already used in this <beans> element
- Offending resource: class path resource [microservice.xml]
- at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:70)
- at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
- at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:80)
- at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.error(BeanDefinitionParserDelegate.java:301)
- at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.checkNameUniqueness(BeanDefinitionParserDelegate.java:511)
- at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseBeanDefinitionElement(BeanDefinitionParserDelegate.java:457)
- at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseBeanDefinitionElement(BeanDefinitionParserDelegate.java:429)
- at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.processBeanDefinition(DefaultBeanDefinitionDocumentReader.java:295)
- at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseDefaultElement(DefaultBeanDefinitionDocumentReader.java:186)
- at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:165)
- at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:138)
- at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:94)
- at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:508)
- at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:392)
- at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)
- at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304)
- at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:239)
- ... 28 more
- 六月 28, 2017 9:02:38 上午 org.apache.catalina.core.StandardContext startInternal
- 严重: One or more listeners failed to start. Full details will be found in the appropriate container log file
- 六月 28, 2017 9:02:38 上午 org.apache.catalina.core.StandardContext startInternal
- 严重: Context [/ms-selection] startup failed due to previous errors
- 六月 28, 2017 9:02:38 上午 org.apache.catalina.core.ApplicationContext log
- 信息: Closing Spring root WebApplicationContext
- 六月 28, 2017 9:02:38 上午 org.apache.catalina.core.StandardContext listenerStop
- 严重: Exception sending context destroyed event to listener instance of class org.springframework.web.context.ContextLoaderListener
- java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext
- at org.springframework.context.support.AbstractRefreshableApplicationContext.getBeanFactory(AbstractRefreshableApplicationContext.java:170)
- at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1010)
- at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:986)
- at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:938)
- at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:581)
- at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:116)
- at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4792)
- at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5429)
- at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:226)
- at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
- at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419)
- at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
- at java.util.concurrent.FutureTask.run(FutureTask.java:266)
- at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
- at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
- at java.lang.Thread.run(Thread.java:748)
- 六月 28, 2017 9:02:38 上午 org.apache.coyote.AbstractProtocol start
- 信息: Starting ProtocolHandler ["http-nio-9090"]
- 六月 28, 2017 9:02:38 上午 org.apache.coyote.AbstractProtocol start
- 信息: Starting ProtocolHandler ["ajp-nio-8009"]
- 六月 28, 2017 9:02:38 上午 org.apache.catalina.startup.Catalina start
- 信息: Server startup in 11670 ms
从报错信息看是说该bean已经被用过,有点让人摸不着头脑,仔细检查了bean加载文件后才发现,在spring-core.xml里加载microservice.xml,而microservice.xml里配置了两个一样名叫ms.selection.abetOrOpposePostService的bean。解决方法是删掉重复bean中的一个,保证bean的ID的唯一性。
tomcat启动报错:Bean name 'XXX' is already used in this <beans> element的更多相关文章
- tomcat启动报错:Injection of autowired dependencies failed
tomcat启动报错:Injectjion of autowired dependencies failed 环境: 操作系统:centos6.5 tomcat: 7.0.52 jdk:openjdk ...
- tomcat启动报错,找不到相应的 queue,从而引发内存泄漏
tomcat启动报错,无法创建 bean listenerStatusChangeDealHandler, no queue 'STOCK.NOTIFY_CHANGE.INTER.CACHE.QUEU ...
- Tomcat启动报错org.springframework.web.context.ContextLoaderListener类配置错误——SHH框架
SHH框架工程,Tomcat启动报错org.springframework.web.context.ContextLoaderListener类配置错误 1.查看配置文件web.xml中是否配置.or ...
- tomcat启动报错Several ports (8080, 8009) required by Tomcat v6.0
tomcat启动报错 如下图: 问题:8080.8009端口已经被占用. 解决办法: 1.在命令提示符下,输入netstat -aon | findstr 8080 2.继续输入taskkill -F ...
- tomcat启动报错
[toc]启动错误 does not exist or is not a readable directory 问题:tomcat启动报错:does not exist or is not a rea ...
- [转]tomcat启动报错too low setting for -Xss
tomcat启动报错too low setting for -Xss 网上给的答案都是调整Xss参数,其实不是正确的做法, -Xss:每个线程的Stack大小,“-Xss 15120” 这使得tomc ...
- tomcat启动报错 ERROR o.a.catalina.session.StandardManager 182 - Exception loading sessions from persiste
系统:centos6.5 x86_64 jdk: 1.8.0_102 tomcat:8.0.37 tomcat 启动报错: ERROR o.a.catalina.session.StandardMan ...
- Tomcat启动报错:[The configuration may be corrupt or incomplete]的解决方案
1,场景说明: 偶然碰见Tomcat启动报错,此时并没有Add任何Web项目: Could not load the Tomcat server configuration at /Servers/T ...
- Tomcat启动报错:StandardServer.await: create[8005] java.net.BindException: Cannot assign requested address
Tomcat启动报错:StandardServer.await: create[8005] java.net.BindException: Cannot assign requested addres ...
- Tomcat启动报错:java.net.BindException: Cannot assign requested address: JVM_Bind
Tomcat启动报错:java.net.BindException: Cannot assign requested address: JVM_Bind Tomcat Cannot assign re ...
随机推荐
- C++中map的用法
map的特性是,所有元素都会根据元素的减值自动被排序.map的所有元素都是pair,同时拥有实值(value)和键值(key).pair的第一个元素会被视为键值,第二个元素会被视为实值.map不允许两 ...
- 使用mysqldump迁移数据
1. 先停止业务,使用MySQLdump的数据导出工具,将您线下原有数据库数据导出为数据文件 mysqldump -hlocalhost -uroot --default-character-set= ...
- scala LocalDateTime String 转换
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");LocalDateTime ti ...
- 全国城市部分js
var areaJson22 = { "id": "0", "name": "全国", "parentId&q ...
- 微信公众号 iOS UITextFiled 用中文键盘输英文出现空格的解决方法
问题出现的现象: 最近公司开发微信公众号邀请码,需要对用户输入进行限制,允许输入的是字母和数字,其他输入会使用正则表达式禁止.但是有iOS用户反映在输入字母过程中,经常几个字母之后,邀请码不对,查看公 ...
- Solr简单测试
import org.apache.solr.client.solrj.SolrClient; import org.apache.solr.client.solrj.SolrQuery; impor ...
- .NET中 数据库连接
(转自:http://www.iwms.net/n459c12.aspx) SQL Server ODBC Standard Security:"Driver={SQL Server};S ...
- Http请求get和post调用
工作中会遇到远程调用接口,需要编写Http请求的共通类 以下是自己总结的Http请求代码 package com.gomecar.index.common.utils; import org.apac ...
- LeetCode OJ:Binary Tree Postorder Traversal(后序遍历二叉树)
Given a binary tree, return the postorder traversal of its nodes' values. For example:Given binary t ...
- LeetCode OJ:Remove Element(移除元素)
Given an array and a value, remove all instances of that value in place and return the new length. T ...