java.lang.NoClassDefFoundError: Could not initialize class ......

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了java.lang.NoClassDefFoundError: Could not initialize class ......相关的知识,希望对你有一定的参考价值。

在测试数据字典工具类的时候一直报这个错误,找了好久,原来是SpringContextUtils这个类没有放入到容器中。

但是我在SpringContextUtils上面加了注解的,为什么注解没有扫到呢?

要不怎么说你蠢呢?

spring配置文件中的base-package没有扫到这个工具类所在的包,我也是醉了。。。。。。

<context:component-scan base-package="xxxx"/>

 

以上是关于java.lang.NoClassDefFoundError: Could not initialize class ......的主要内容,如果未能解决你的问题,请参考以下文章