项目启动时报错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> ...
随机推荐
- SharpZipLib 压缩ZIP导出
var uploadSectionDir = Path.Combine("Upload", "QQ", DateTime.Now.ToString(" ...
- SenjuFamily项目总结 之 Activiti 学习总结(一)
项目干了一年了,最近开始整理一下项目中用到的知识,算是年末总结了. 大概有如下几个点: 1.Actitivi 2.JPA 3.WebService 4.JVM使用以及代码优化(这个地方,主要参考周志明 ...
- 【BZOJ3242】【UOJ#126】【NOI2013】快餐店
NOI都是这种难度的题怎么玩嘛QAQ 原题: 小T打算在城市C开设一家外送快餐店.送餐到某一个地点的时间与外卖店到该地点之间最短路径长度是成正比的,小T希望快餐店的地址选在离最远的顾客距离最近的地方. ...
- mysql深入
使用存储过程 create procedure productpricing() begin select avg(prod_price) as priceaverage from products; ...
- day 56 jQuery学习
1.补充:each 描述:一个通用的迭代函数,它可以用来无缝迭代对象和数组.数组和类似数组的对象通过一个长度属性(如一个函数的参数对象)来迭代数字索引,从0到length - 1.其他对象通过其属性名 ...
- Avoiding post increase or decrease
When we write a loop, most of us will use post increase or decrease, but there is a better solution. ...
- .Net培训班课程体系
.Net培训 第一部分:.Net基础 .Net基础:数据类型.变量.运算符.分支结构.循环结构.方法.反编译器.递归.递归算法的非递归优化: 面向对象:异常.封装继承多态.单例模式.装饰者设计模式.t ...
- webpack 中,loader、plugin 的区别
loader 和 plugin 的主要区别: loader 用于加载某些资源文件. 因为 webpack 只能理解 JavaScript 和 JSON 文件,对于其他资源例如 css,图片,或者其他的 ...
- hive 安装 和基本使用
hive是什么: hive是一个数据仓库,hive不是一个数据库,hive 不没有自己的数据,hive的数据存在hdfs 中,hive 依赖一个关系型数据库来存储 自己在 hdfs 中的数据的映射关系 ...
- hdfs 例子
package hadoop; import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; ...