个人博客 地址:http://www.wenhaofan.com/article/20180921134534

错误信息

  1. ERROR [localhost-startStop-1] - Context initialization failed
  2. java.lang.IllegalArgumentException
  3. at org.springframework.asm.ClassReader.<init>(Unknown Source)
  4. at org.springframework.asm.ClassReader.<init>(Unknown Source)
  5. at org.springframework.asm.ClassReader.<init>(Unknown Source)
  6. at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:52)
  7. at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:80)
  8. at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:101)
  9. at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:76)
  10. at org.springframework.context.annotation.ConfigurationClassParser.getImports(ConfigurationClassParser.java:298)
  11. at org.springframework.context.annotation.ConfigurationClassParser.getImports(ConfigurationClassParser.java:300)
  12. at org.springframework.context.annotation.ConfigurationClassParser.getImports(ConfigurationClassParser.java:300)
  13. at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:230)
  14. at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:153)
  15. at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:130)
  16. at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:285)
  17. at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:223)
  18. at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:630)
  19. at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:461)
  20. at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:383)
  21. at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283)
  22. at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
  23. at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4853)
  24. at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5314)
  25. at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
  26. at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
  27. at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
  28. at java.util.concurrent.FutureTask.run(FutureTask.java:266)
  29. at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
  30. at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
  31. at java.lang.Thread.run(Thread.java:745)
  32. 九月 21, 2018 1:42:39 下午 org.apache.catalina.core.StandardContext listenerStart
  33. 严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
  34. java.lang.IllegalArgumentException
  35. at org.springframework.asm.ClassReader.<init>(Unknown Source)
  36. at org.springframework.asm.ClassReader.<init>(Unknown Source)
  37. at org.springframework.asm.ClassReader.<init>(Unknown Source)
  38. at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:52)
  39. at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:80)
  40. at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:101)
  41. at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:76)
  42. at org.springframework.context.annotation.ConfigurationClassParser.getImports(ConfigurationClassParser.java:298)
  43. at org.springframework.context.annotation.ConfigurationClassParser.getImports(ConfigurationClassParser.java:300)
  44. at org.springframework.context.annotation.ConfigurationClassParser.getImports(ConfigurationClassParser.java:300)
  45. at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:230)
  46. at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:153)
  47. at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:130)
  48. at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:285)
  49. at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:223)
  50. at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:630)
  51. at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:461)
  52. at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:383)
  53. at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283)
  54. at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
  55. at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4853)
  56. at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5314)
  57. at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
  58. at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
  59. at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
  60. at java.util.concurrent.FutureTask.run(FutureTask.java:266)
  61. at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
  62. at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
  63. at java.lang.Thread.run(Thread.java:745)
  64.  
  65. 九月 21, 2018 1:42:39 下午 org.apache.catalina.core.StandardContext startInternal
  66. 严重: One or more listeners failed to start. Full details will be found in the appropriate container log file
  67. 九月 21, 2018 1:42:39 下午 org.apache.catalina.core.StandardContext startInternal
  68. 严重: Context [/nmsms] startup failed due to previous errors
  69. 九月 21, 2018 1:42:39 下午 org.apache.catalina.core.ApplicationContext log
  70. 信息: Closing Spring root WebApplicationContext
  71. INFO [localhost-startStop-1] - Closing Root WebApplicationContext: startup date [Fri Sep 21 13:42:38 CST 2018]; root of context hierarchy
  72. WARN [localhost-startStop-1] - Exception thrown from ApplicationListener handling ContextClosedEvent
  73. java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: Root WebApplicationContext: startup date [Fri Sep 21 13:42:38 CST 2018]; root of context hierarchy
  74. at org.springframework.context.support.AbstractApplicationContext.getApplicationEventMulticaster(AbstractApplicationContext.java:347)
  75. at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:334)
  76. at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1049)
  77. at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1010)
  78. at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:549)
  79. at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:143)
  80. at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4900)
  81. at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5537)
  82. at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:221)
  83. at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:149)
  84. at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
  85. at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
  86. at java.util.concurrent.FutureTask.run(FutureTask.java:266)
  87. at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
  88. at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
  89. at java.lang.Thread.run(Thread.java:745)
  90. WARN [localhost-startStop-1] - Exception thrown from LifecycleProcessor on context close
  91. java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' before invoking lifecycle methods via the context: Root WebApplicationContext: startup date [Fri Sep 21 13:42:38 CST 2018]; root of context hierarchy
  92. at org.springframework.context.support.AbstractApplicationContext.getLifecycleProcessor(AbstractApplicationContext.java:360)
  93. at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1057)
  94. at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1010)
  95. at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:549)
  96. at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:143)
  97. at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4900)
  98. at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5537)
  99. at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:221)
  100. at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:149)
  101. at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
  102. at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
  103. at java.util.concurrent.FutureTask.run(FutureTask.java:266)
  104. at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
  105. at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
  106. at java.lang.Thread.run(Thread.java:745)

纠正

经查找原因发现是因为运行项目需要jdk1.7而运行项目时使用的是jdk1.8,于是执行下面3步

1.修改Build path中的Jdk版本

2.修改project->properties->java Compiler 中的jdk版本

3.修改project->properties->jproject facets 中的jdk版本

tomcat配置

如果你的项目使用tomcat运行则还需要在创建tomcat server时指定jre版本为1.7,如下图所示

然后在项目的build path中使用新得server runtime,并且在eclipse中使用新配置的tomcat来运行项目

spring项目启动报错的更多相关文章

  1. spring项目启动报错BeanFactory not initialized or already closed

    spring项目启动的时候报如下错误: java.lang.IllegalStateException: BeanFactory not initialized or already closed - ...

  2. 【spring cloud】【spring boot】项目启动报错:Cannot determine embedded database driver class for database type NONE

    解决参考文章:https://blog.csdn.net/hengyunabc/article/details/78762097 spring boot启动报错如下: Error starting A ...

  3. Linux下Tomcat项目启动报错

    Linux下Tomcat项目启动报错 org.springframework.beans.factory.CannotLoadBeanClassException: Error loading cla ...

  4. Eureka Server项目启动报错处理

    Eureka Server项目启动报错处理 Eureka是一个服务发现组件,提供服务注册.发现等注册中心功能,使用spring boot启动eureka应用时出现报错: 20:36:17.646 [r ...

  5. springboot项目启动报错Failed to configure a DataSource: 'url' attribute is not specified and no embedde

    springboot项目启动报错Failed to configure a DataSource: 'url' attribute is not specified and no embedde 创建 ...

  6. SSM项目启动报错:Failed to read candidate component class

    SSM项目启动报错:Failed to read candidate component class 换成3.1又没有问题,换成3.2又不行,查看编译环境用的是1.8,将1.8降为1.7,问题解决,服 ...

  7. eclipse 中导入 maven项目 启动报错

    导入Maven项目到Eclipse中时,出现问题如下: java.lang.ClassNotFoundException: org.springframework.web.context.Contex ...

  8. Spring boot 启动报错 Failed to auto-configure a DataSource

    1.Spring boot 启动报错 Failed to auto-configure a DataSource 参考资料https://blog.csdn.net/liuyinfei_java/ar ...

  9. spring Boot启动报错Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.springframework.core.annotation.AnnotatedElementUtils.getAnnotationAttributes

    spring boot 启动报错如下 org.springframework.context.ApplicationContextException: Unable to start web serv ...

随机推荐

  1. deepin系统修改IP地址记录

    今天在配置软路由的时候需要设备有线网卡为静态地址,于是便按照如下方法进行修改: 1.备份网络配置文件: sudo cp /etc/network/interfaces /etc/netword/int ...

  2. Leetcode:235. 二叉搜索树的最近公共祖先

    Leetcode:235. 二叉搜索树的最近公共祖先 Leetcode:235. 二叉搜索树的最近公共祖先 Talk is cheap . Show me the code . /** * Defin ...

  3. php压缩文件zip格式并打包(单个或多个文件压缩)

    最近接到一个需求,就是选择多个文件下载时,不要一个一个下载,直接把多个文件打包成一个文件进行下载.我们项目是前后端分离,所以我写了个接口,让前端传参数,后台下载. 废话不多说,直接上代码: 先是压缩单 ...

  4. Centos7下安装包方式安装MySQL

    安装包下载地址:https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.27-1.el7.x86_64.rpm-bundle.tar 第一步:在 /h ...

  5. 有多少人在面试时,被Java 如何线程间通讯,问哭了?

    正常情况下,每个子线程完成各自的任务就可以结束了.不过有的时候,我们希望多个线程协同工作来完成某个任务,这时就涉及到了线程间通信了. 本文涉及到的知识点: thread.join(), object. ...

  6. 获取Windows平台下 安装office 版本位数信息

    最近在处理客户端安装程序过程,有一个需求:需要检测Windows平台下安装office 版本信息以及获取使用的office是32 位还是64 位: 当检测出office 位数为64位时,提示当前off ...

  7. Java中顺序、并行与并发

    顺序(sequential)用于表示多个操作依次处理.例如把十个操作交给一个人处理 并行(parallel)用于表示多个操作同时处理.比如是个操作分给两个人操作,两个人会并行处理 并发(concurr ...

  8. SpringBoot 教程之发送邮件

    目录   1. 简介  2. API  3. 配置  4. 实战  5. 示例源码  6. 参考资料 1. 简介 Spring Boot 收发邮件最简便方式是通过 spring-boot-starte ...

  9. ROS 环境变量配置

    unbantu16.04 linux 版本,  ros系统 kinetic版本 1. ros系统可以通过rospack find  package_name  /   rosrun package_n ...

  10. honeywell1900扫描枪的使用说明

    霍尼韦尔1900扫描枪驱动是honeywell1900扫描枪的USB驱动,就是扫描枪usb转com,如果你的系统是32位的,就直接运行Install_x86.bat,如果是64位的,就运行Instal ...