spring项目启动报错
个人博客 地址:http://www.wenhaofan.com/article/20180921134534
错误信息
- ERROR [localhost-startStop-1] - Context initialization failed
- java.lang.IllegalArgumentException
- at org.springframework.asm.ClassReader.<init>(Unknown Source)
- at org.springframework.asm.ClassReader.<init>(Unknown Source)
- at org.springframework.asm.ClassReader.<init>(Unknown Source)
- at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:52)
- at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:80)
- at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:101)
- at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:76)
- at org.springframework.context.annotation.ConfigurationClassParser.getImports(ConfigurationClassParser.java:298)
- at org.springframework.context.annotation.ConfigurationClassParser.getImports(ConfigurationClassParser.java:300)
- at org.springframework.context.annotation.ConfigurationClassParser.getImports(ConfigurationClassParser.java:300)
- at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:230)
- at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:153)
- at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:130)
- at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:285)
- at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:223)
- at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:630)
- at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:461)
- at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:383)
- at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283)
- at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
- at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4853)
- at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5314)
- at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
- at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
- at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
- 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:745)
- 九月 21, 2018 1:42:39 下午 org.apache.catalina.core.StandardContext listenerStart
- 严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
- java.lang.IllegalArgumentException
- at org.springframework.asm.ClassReader.<init>(Unknown Source)
- at org.springframework.asm.ClassReader.<init>(Unknown Source)
- at org.springframework.asm.ClassReader.<init>(Unknown Source)
- at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:52)
- at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:80)
- at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:101)
- at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:76)
- at org.springframework.context.annotation.ConfigurationClassParser.getImports(ConfigurationClassParser.java:298)
- at org.springframework.context.annotation.ConfigurationClassParser.getImports(ConfigurationClassParser.java:300)
- at org.springframework.context.annotation.ConfigurationClassParser.getImports(ConfigurationClassParser.java:300)
- at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:230)
- at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:153)
- at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:130)
- at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:285)
- at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:223)
- at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:630)
- at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:461)
- at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:383)
- at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283)
- at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
- at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4853)
- at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5314)
- at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
- at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
- at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
- 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:745)
- 九月 21, 2018 1:42:39 下午 org.apache.catalina.core.StandardContext startInternal
- 严重: One or more listeners failed to start. Full details will be found in the appropriate container log file
- 九月 21, 2018 1:42:39 下午 org.apache.catalina.core.StandardContext startInternal
- 严重: Context [/nmsms] startup failed due to previous errors
- 九月 21, 2018 1:42:39 下午 org.apache.catalina.core.ApplicationContext log
- 信息: Closing Spring root WebApplicationContext
- INFO [localhost-startStop-1] - Closing Root WebApplicationContext: startup date [Fri Sep 21 13:42:38 CST 2018]; root of context hierarchy
- WARN [localhost-startStop-1] - Exception thrown from ApplicationListener handling ContextClosedEvent
- 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
- at org.springframework.context.support.AbstractApplicationContext.getApplicationEventMulticaster(AbstractApplicationContext.java:347)
- at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:334)
- at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1049)
- at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1010)
- at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:549)
- at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:143)
- at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4900)
- at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5537)
- at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:221)
- at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:149)
- at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
- at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
- 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:745)
- WARN [localhost-startStop-1] - Exception thrown from LifecycleProcessor on context close
- 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
- at org.springframework.context.support.AbstractApplicationContext.getLifecycleProcessor(AbstractApplicationContext.java:360)
- at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1057)
- at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1010)
- at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:549)
- at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:143)
- at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4900)
- at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5537)
- at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:221)
- at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:149)
- at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
- at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
- 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: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项目启动报错的更多相关文章
- spring项目启动报错BeanFactory not initialized or already closed
spring项目启动的时候报如下错误: java.lang.IllegalStateException: BeanFactory not initialized or already closed - ...
- 【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 ...
- Linux下Tomcat项目启动报错
Linux下Tomcat项目启动报错 org.springframework.beans.factory.CannotLoadBeanClassException: Error loading cla ...
- Eureka Server项目启动报错处理
Eureka Server项目启动报错处理 Eureka是一个服务发现组件,提供服务注册.发现等注册中心功能,使用spring boot启动eureka应用时出现报错: 20:36:17.646 [r ...
- 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 创建 ...
- SSM项目启动报错:Failed to read candidate component class
SSM项目启动报错:Failed to read candidate component class 换成3.1又没有问题,换成3.2又不行,查看编译环境用的是1.8,将1.8降为1.7,问题解决,服 ...
- eclipse 中导入 maven项目 启动报错
导入Maven项目到Eclipse中时,出现问题如下: java.lang.ClassNotFoundException: org.springframework.web.context.Contex ...
- Spring boot 启动报错 Failed to auto-configure a DataSource
1.Spring boot 启动报错 Failed to auto-configure a DataSource 参考资料https://blog.csdn.net/liuyinfei_java/ar ...
- 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 ...
随机推荐
- deepin系统修改IP地址记录
今天在配置软路由的时候需要设备有线网卡为静态地址,于是便按照如下方法进行修改: 1.备份网络配置文件: sudo cp /etc/network/interfaces /etc/netword/int ...
- Leetcode:235. 二叉搜索树的最近公共祖先
Leetcode:235. 二叉搜索树的最近公共祖先 Leetcode:235. 二叉搜索树的最近公共祖先 Talk is cheap . Show me the code . /** * Defin ...
- php压缩文件zip格式并打包(单个或多个文件压缩)
最近接到一个需求,就是选择多个文件下载时,不要一个一个下载,直接把多个文件打包成一个文件进行下载.我们项目是前后端分离,所以我写了个接口,让前端传参数,后台下载. 废话不多说,直接上代码: 先是压缩单 ...
- Centos7下安装包方式安装MySQL
安装包下载地址:https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.27-1.el7.x86_64.rpm-bundle.tar 第一步:在 /h ...
- 有多少人在面试时,被Java 如何线程间通讯,问哭了?
正常情况下,每个子线程完成各自的任务就可以结束了.不过有的时候,我们希望多个线程协同工作来完成某个任务,这时就涉及到了线程间通信了. 本文涉及到的知识点: thread.join(), object. ...
- 获取Windows平台下 安装office 版本位数信息
最近在处理客户端安装程序过程,有一个需求:需要检测Windows平台下安装office 版本信息以及获取使用的office是32 位还是64 位: 当检测出office 位数为64位时,提示当前off ...
- Java中顺序、并行与并发
顺序(sequential)用于表示多个操作依次处理.例如把十个操作交给一个人处理 并行(parallel)用于表示多个操作同时处理.比如是个操作分给两个人操作,两个人会并行处理 并发(concurr ...
- SpringBoot 教程之发送邮件
目录 1. 简介 2. API 3. 配置 4. 实战 5. 示例源码 6. 参考资料 1. 简介 Spring Boot 收发邮件最简便方式是通过 spring-boot-starte ...
- ROS 环境变量配置
unbantu16.04 linux 版本, ros系统 kinetic版本 1. ros系统可以通过rospack find package_name / rosrun package_n ...
- honeywell1900扫描枪的使用说明
霍尼韦尔1900扫描枪驱动是honeywell1900扫描枪的USB驱动,就是扫描枪usb转com,如果你的系统是32位的,就直接运行Install_x86.bat,如果是64位的,就运行Instal ...