项目启动时报错Instantiation of bean failed; nested exception is java.lang.ExceptionInInitializerError
解决过程:
1、检查配置,反反复复看了很多遍,确认没有问题。
2、 网上找了很多资料,类似的问题很多,看过答案以后依旧不得其要领。只好继续看报错代码,直到看到这一句:
|
1
2
3
4
|
Caused by: java.lang.NullPointerException at ***.***.SearchIPAttributionService.load(SearchIPAttributionService.java:133) at ***.***.SearchIPAttributionService.load(SearchIPAttributionService.java:66) at ***.***.SearchIPAttributionService.<clinit>(SearchIPAttributionService.java:28) |
问题应该在本身的代码上,但是,我记得代码是测试过的,没有问题。但是,没有其他办法,只能顺着提示一步步寻找问题所在。最终,确实问题出在代码上。Spring在实例化这个类的时候,先执行静态方法,此时某个类还未实例化,故而报了这个空指针错误。
经验教训:
1、解决问题,不要急躁,要淡定,淡定,淡定。
2、仔细看报错信息。
3、每次修改过代码以后,都要记得进行测试,确保修改是正确的。
项目启动时报错Instantiation of bean failed; nested exception is java.lang.ExceptionInInitializerError的更多相关文章
- 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 ...
- 异常:Instantiation of bean failed; nested exception is java.lang.NoSuchMethodError: com.google.common.base.Preconditions.che ckState(ZLjava/lang/String;I)V
Instantiation of bean failed; nested exception is java.lang.NoSuchMethodError: com.google.common.bas ...
- springboot启动报错:Handler dispatch failed; nested exception is java.lang.AbstractMethodError
最近在用springboot构建项目,控制台报错:Handler dispatch failed; nested exception is java.lang.AbstractMethodError, ...
- dubbo-Instantiation of bean failed; nested exception is java.lang.ExceptionInInitializerError
dubbo-2.8.4需用jdk版本为1.8,dubbo-2.5.3可以使用1.7版本的jdk.
- Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/objectweb/asm/Type
问题描述 将项目挂载到 Myeclipse 的 tomcat 上,启动 tomcat ,报错“Initialization of bean failed; nested exception is ja ...
- Error creating bean with name 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0': Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.springframework
昨晚在 使用spring aop, 然后Tomcat启动的时候, 报了这么个错: Caused by: org.springframework.beans.factory.BeanCreationEx ...
- Initialization of bean failed; nested exception is java.lang.reflect.MalformedParameterizedTypeExcep
body { font-family: "Microsoft YaHei UI","Microsoft YaHei",SimSun,"Segoe UI ...
- Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: javax/jms/JMSContext
参考链接 : https://blog.csdn.net/angus_Lucky/article/details/82811946?utm_source=blogxgwz7 org.springfra ...
- QA:Initialization of bean failed; nested exception is java.lang.AbstractMethodError
Q: <hibernate.version>5.2.10.Final</hibernate.version><dependency> <groupId> ...
随机推荐
- #505 1&2 A-C 后面未完成
A. Doggo Recoloring 题目意思是给一个字符串(都是小写字母),如果有两个字符相同,我们可以将这两个字符变成其他字符,问能不能使字符串字母都一样 思路 有两个相同字符时就能: 字符 ...
- ApplicationContext之getBean方法详解
转自:http://www.sohu.com/a/115194552_466964 我们知道可以通过ApplicationContext的getBean方法来获取Spring容器中已初始化的bean. ...
- SCS Characteristics
Each SCS is an autonomous web application. For the SCS's domain, all data, the logic to process that ...
- lapis 1.7.0 更好的openresty 版本兼容以及安全数据库支持
lapis 1.7.0 今年4月2号就发布了,一直没有注意,今天看到changelog就简单的进行了一个 测试(主要是与openresty版本的测试,新变更后边会有) 使用docker-compose ...
- 自定义简单的模板引擎-JS模板引擎
http://www.cnblogs.com/52fhy/p/5393673.html
- enum和数据库entity互转
注意,code和desc都是string的,数据库的entity是integer,dto的是enum,所以需要一个转换 entity转dto EnumGender.getEnum(String.val ...
- spring boot 项目 热启动
第一需要 spring-boot-devtools 依赖 <dependency> <groupId>org.springframework.boot</groupId& ...
- python selenium-webdriver 生成测试报告 (十四)
测试最后的一个重要的过程就是生成一份完整的测试报告,生成测试报告的主要是通过python的一个第三方模块HTMLTestRunner.py生成,但是生成的测试报告不是特别的美观,而且没有办法统计测试结 ...
- VC++6 调用teststand api的方法
参考example中的vs2010的例子,创建MFC工程 打开project->setting ,c/c++ tab cat 选 Proprocessor ->Additional in ...
- Linux paste命令详解
Linux paste命令 Linux paste命令用于合并文件的列.paste指令会把每个文件以列对列的方式,一列列地加以合并 将每个指定文件里的每一行整合到对应一行里写到标准输出,之间用制表符分 ...