如题,tomcat容器启动时加载spring的bean,结果报错如下:

  1. 六月 28, 2017 9:02:25 上午 org.apache.tomcat.util.digester.SetPropertiesRule begin
  2. 警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:ms-selection' did not find a matching property.
  3. 六月 28, 2017 9:02:25 上午 org.apache.catalina.startup.VersionLoggerListener log
  4. 信息: Server version: Apache Tomcat/8.5.13
  5. 六月 28, 2017 9:02:25 上午 org.apache.catalina.startup.VersionLoggerListener log
  6. 信息: Server built: Mar 27 2017 14:25:04 UTC
  7. 六月 28, 2017 9:02:25 上午 org.apache.catalina.startup.VersionLoggerListener log
  8. 信息: Server number: 8.5.13.0
  9. 六月 28, 2017 9:02:25 上午 org.apache.catalina.startup.VersionLoggerListener log
  10. 信息: OS Name: Windows 7
  11. 六月 28, 2017 9:02:25 上午 org.apache.catalina.startup.VersionLoggerListener log
  12. 信息: OS Version: 6.1
  13. 六月 28, 2017 9:02:25 上午 org.apache.catalina.startup.VersionLoggerListener log
  14. 信息: Architecture: amd64
  15. 六月 28, 2017 9:02:25 上午 org.apache.catalina.startup.VersionLoggerListener log
  16. 信息: Java Home: D:\wulinfeng\Java\jdk1.8.0_131\jre
  17. 六月 28, 2017 9:02:25 上午 org.apache.catalina.startup.VersionLoggerListener log
  18. 信息: JVM Version: 1.8.0_131-b11
  19. 六月 28, 2017 9:02:25 上午 org.apache.catalina.startup.VersionLoggerListener log
  20. 信息: JVM Vendor: Oracle Corporation
  21. 六月 28, 2017 9:02:25 上午 org.apache.catalina.startup.VersionLoggerListener log
  22. 信息: CATALINA_BASE: E:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
  23. 六月 28, 2017 9:02:25 上午 org.apache.catalina.startup.VersionLoggerListener log
  24. 信息: CATALINA_HOME: D:\wulinfeng\tomcat\apache-tomcat-8.5.13
  25. 六月 28, 2017 9:02:25 上午 org.apache.catalina.startup.VersionLoggerListener log
  26. 信息: Command line argument: -agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:55079
  27. 六月 28, 2017 9:02:25 上午 org.apache.catalina.startup.VersionLoggerListener log
  28. 信息: Command line argument: -Dcatalina.base=E:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
  29. 六月 28, 2017 9:02:25 上午 org.apache.catalina.startup.VersionLoggerListener log
  30. 信息: Command line argument: -Dcatalina.home=D:\wulinfeng\tomcat\apache-tomcat-8.5.13
  31. 六月 28, 2017 9:02:25 上午 org.apache.catalina.startup.VersionLoggerListener log
  32. 信息: Command line argument: -Dwtp.deploy=E:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps
  33. 六月 28, 2017 9:02:25 上午 org.apache.catalina.startup.VersionLoggerListener log
  34. 信息: Command line argument: -Djava.endorsed.dirs=D:\wulinfeng\tomcat\apache-tomcat-8.5.13\endorsed
  35. 六月 28, 2017 9:02:25 上午 org.apache.catalina.startup.VersionLoggerListener log
  36. 信息: Command line argument: -Dfile.encoding=UTF-8
  37. 六月 28, 2017 9:02:25 上午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
  38. 信息: Loaded APR based Apache Tomcat Native library 1.2.12 using APR version 1.5.2.
  39. 六月 28, 2017 9:02:25 上午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
  40. 信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
  41. 六月 28, 2017 9:02:25 上午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
  42. 信息: APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
  43. 六月 28, 2017 9:02:26 上午 org.apache.catalina.core.AprLifecycleListener initializeSSL
  44. 信息: OpenSSL successfully initialized (OpenSSL 1.0.2k 26 Jan 2017)
  45. 六月 28, 2017 9:02:26 上午 org.apache.coyote.AbstractProtocol init
  46. 信息: Initializing ProtocolHandler ["http-nio-9090"]
  47. 六月 28, 2017 9:02:27 上午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
  48. 信息: Using a shared selector for servlet write/read
  49. 六月 28, 2017 9:02:27 上午 org.apache.coyote.AbstractProtocol init
  50. 信息: Initializing ProtocolHandler ["ajp-nio-8009"]
  51. 六月 28, 2017 9:02:27 上午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
  52. 信息: Using a shared selector for servlet write/read
  53. 六月 28, 2017 9:02:27 上午 org.apache.catalina.startup.Catalina load
  54. 信息: Initialization processed in 2954 ms
  55. 六月 28, 2017 9:02:27 上午 org.apache.catalina.core.StandardService startInternal
  56. 信息: Starting service Catalina
  57. 六月 28, 2017 9:02:27 上午 org.apache.catalina.core.StandardEngine startInternal
  58. 信息: Starting Servlet Engine: Apache Tomcat/8.5.13
  59. 六月 28, 2017 9:02:34 上午 org.apache.jasper.servlet.TldScanner scanJars
  60. 信息: 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.
  61. 六月 28, 2017 9:02:34 上午 org.apache.catalina.core.ApplicationContext log
  62. 信息: No Spring WebApplicationInitializer types detected on classpath
  63. 六月 28, 2017 9:02:36 上午 org.apache.catalina.core.ApplicationContext log
  64. 信息: Initializing Spring root WebApplicationContext
  65. 六月 28, 2017 9:02:38 上午 org.apache.catalina.core.StandardContext listenerStart
  66. 严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
  67. org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from relative location [microservice.xml]
  68. 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
  69. Offending resource: class path resource [microservice.xml]
  70.  
  71. at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:70)
  72. at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
  73. at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:76)
  74. at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:255)
  75. at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseDefaultElement(DefaultBeanDefinitionDocumentReader.java:180)
  76. at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:165)
  77. at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:138)
  78. at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:94)
  79. at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:508)
  80. at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:392)
  81. at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)
  82. at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304)
  83. at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:181)
  84. at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:217)
  85. at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:188)
  86. at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)
  87. at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
  88. at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129)
  89. at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:612)
  90. at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:513)
  91. at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:444)
  92. at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:326)
  93. at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
  94. at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4745)
  95. at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5207)
  96. at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
  97. at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419)
  98. at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
  99. at java.util.concurrent.FutureTask.run(FutureTask.java:266)
  100. at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
  101. at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
  102. at java.lang.Thread.run(Thread.java:748)
  103. Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Bean name 'ms.selection.abetOrOpposePostService' is already used in this <beans> element
  104. Offending resource: class path resource [microservice.xml]
  105.  
  106. at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:70)
  107. at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
  108. at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:80)
  109. at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.error(BeanDefinitionParserDelegate.java:301)
  110. at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.checkNameUniqueness(BeanDefinitionParserDelegate.java:511)
  111. at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseBeanDefinitionElement(BeanDefinitionParserDelegate.java:457)
  112. at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseBeanDefinitionElement(BeanDefinitionParserDelegate.java:429)
  113. at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.processBeanDefinition(DefaultBeanDefinitionDocumentReader.java:295)
  114. at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseDefaultElement(DefaultBeanDefinitionDocumentReader.java:186)
  115. at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:165)
  116. at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:138)
  117. at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:94)
  118. at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:508)
  119. at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:392)
  120. at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)
  121. at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304)
  122. at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:239)
  123. ... 28 more
  124.  
  125. 六月 28, 2017 9:02:38 上午 org.apache.catalina.core.StandardContext startInternal
  126. 严重: One or more listeners failed to start. Full details will be found in the appropriate container log file
  127. 六月 28, 2017 9:02:38 上午 org.apache.catalina.core.StandardContext startInternal
  128. 严重: Context [/ms-selection] startup failed due to previous errors
  129. 六月 28, 2017 9:02:38 上午 org.apache.catalina.core.ApplicationContext log
  130. 信息: Closing Spring root WebApplicationContext
  131. 六月 28, 2017 9:02:38 上午 org.apache.catalina.core.StandardContext listenerStop
  132. 严重: Exception sending context destroyed event to listener instance of class org.springframework.web.context.ContextLoaderListener
  133. java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext
  134. at org.springframework.context.support.AbstractRefreshableApplicationContext.getBeanFactory(AbstractRefreshableApplicationContext.java:170)
  135. at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1010)
  136. at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:986)
  137. at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:938)
  138. at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:581)
  139. at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:116)
  140. at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4792)
  141. at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5429)
  142. at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:226)
  143. at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
  144. at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419)
  145. at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
  146. at java.util.concurrent.FutureTask.run(FutureTask.java:266)
  147. at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
  148. at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
  149. at java.lang.Thread.run(Thread.java:748)
  150.  
  151. 六月 28, 2017 9:02:38 上午 org.apache.coyote.AbstractProtocol start
  152. 信息: Starting ProtocolHandler ["http-nio-9090"]
  153. 六月 28, 2017 9:02:38 上午 org.apache.coyote.AbstractProtocol start
  154. 信息: Starting ProtocolHandler ["ajp-nio-8009"]
  155. 六月 28, 2017 9:02:38 上午 org.apache.catalina.startup.Catalina start
  156. 信息: 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的更多相关文章

  1. tomcat启动报错:Injection of autowired dependencies failed

    tomcat启动报错:Injectjion of autowired dependencies failed 环境: 操作系统:centos6.5 tomcat: 7.0.52 jdk:openjdk ...

  2. tomcat启动报错,找不到相应的 queue,从而引发内存泄漏

    tomcat启动报错,无法创建 bean listenerStatusChangeDealHandler, no queue 'STOCK.NOTIFY_CHANGE.INTER.CACHE.QUEU ...

  3. Tomcat启动报错org.springframework.web.context.ContextLoaderListener类配置错误——SHH框架

    SHH框架工程,Tomcat启动报错org.springframework.web.context.ContextLoaderListener类配置错误 1.查看配置文件web.xml中是否配置.or ...

  4. tomcat启动报错Several ports (8080, 8009) required by Tomcat v6.0

    tomcat启动报错 如下图: 问题:8080.8009端口已经被占用. 解决办法: 1.在命令提示符下,输入netstat -aon | findstr 8080 2.继续输入taskkill -F ...

  5. tomcat启动报错

    [toc]启动错误 does not exist or is not a readable directory 问题:tomcat启动报错:does not exist or is not a rea ...

  6. [转]tomcat启动报错too low setting for -Xss

    tomcat启动报错too low setting for -Xss 网上给的答案都是调整Xss参数,其实不是正确的做法, -Xss:每个线程的Stack大小,“-Xss 15120” 这使得tomc ...

  7. 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 ...

  8. Tomcat启动报错:[The configuration may be corrupt or incomplete]的解决方案

    1,场景说明: 偶然碰见Tomcat启动报错,此时并没有Add任何Web项目: Could not load the Tomcat server configuration at /Servers/T ...

  9. Tomcat启动报错:StandardServer.await: create[8005] java.net.BindException: Cannot assign requested address

    Tomcat启动报错:StandardServer.await: create[8005] java.net.BindException: Cannot assign requested addres ...

  10. Tomcat启动报错:java.net.BindException: Cannot assign requested address: JVM_Bind

    Tomcat启动报错:java.net.BindException: Cannot assign requested address: JVM_Bind Tomcat Cannot assign re ...

随机推荐

  1. C++中map的用法

    map的特性是,所有元素都会根据元素的减值自动被排序.map的所有元素都是pair,同时拥有实值(value)和键值(key).pair的第一个元素会被视为键值,第二个元素会被视为实值.map不允许两 ...

  2. 使用mysqldump迁移数据

    1. 先停止业务,使用MySQLdump的数据导出工具,将您线下原有数据库数据导出为数据文件 mysqldump -hlocalhost -uroot --default-character-set= ...

  3. scala LocalDateTime String 转换

    DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");LocalDateTime ti ...

  4. 全国城市部分js

    var areaJson22 = { "id": "0", "name": "全国", "parentId&q ...

  5. 微信公众号 iOS UITextFiled 用中文键盘输英文出现空格的解决方法

    问题出现的现象: 最近公司开发微信公众号邀请码,需要对用户输入进行限制,允许输入的是字母和数字,其他输入会使用正则表达式禁止.但是有iOS用户反映在输入字母过程中,经常几个字母之后,邀请码不对,查看公 ...

  6. Solr简单测试

    import org.apache.solr.client.solrj.SolrClient; import org.apache.solr.client.solrj.SolrQuery; impor ...

  7. .NET中 数据库连接

    (转自:http://www.iwms.net/n459c12.aspx) SQL Server ODBC  Standard Security:"Driver={SQL Server};S ...

  8. Http请求get和post调用

    工作中会遇到远程调用接口,需要编写Http请求的共通类 以下是自己总结的Http请求代码 package com.gomecar.index.common.utils; import org.apac ...

  9. LeetCode OJ:Binary Tree Postorder Traversal(后序遍历二叉树)

    Given a binary tree, return the postorder traversal of its nodes' values. For example:Given binary t ...

  10. LeetCode OJ:Remove Element(移除元素)

    Given an array and a value, remove all instances of that value in place and return the new length. T ...