欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

java.lang.ExceptionInInitializerError

程序员文章站 2022-05-21 16:23:56
initializationError(cn.ljlin233.bean.soundsystem.CDPlayerTest) Time elapsed: 0.005 sec <<< ERROR!java.lang.ExceptionInInitializerError at sun.reflect. ......

initializationerror(cn.ljlin233.bean.soundsystem.cdplayertest) time elapsed: 0.005 sec <<< error!
java.lang.exceptionininitializererror
  at sun.reflect.nativeconstructoraccessorimpl.newinstance0(native method)
  at sun.reflect.nativeconstructoraccessorimpl.newinstance(nativeconstructoraccessorimpl.java:62)
  at sun.reflect.delegatingconstructoraccessorimpl.newinstance(delegatingconstructoraccessorimpl.java:45)
  at java.lang.reflect.constructor.newinstance(constructor.java:423)
  at org.junit.internal.builders.annotatedbuilder.buildrunner(annotatedbuilder.java:31)
  at org.junit.internal.builders.annotatedbuilder.runnerforclass(annotatedbuilder.java:24)
  at org.junit.runners.model.runnerbuilder.saferunnerforclass(runnerbuilder.java:57)
  at org.junit.internal.builders.alldefaultpossibilitiesbuilder.runnerforclass(alldefaultpossibilitiesbuilder.java:29)
  at org.junit.runners.model.runnerbuilder.saferunnerforclass(runnerbuilder.java:57)

 

在使用junit和spring时出现,原因时junit版本过低,或者spring版本过高。

将junit版本从4.7改为4.12后解决,spring为4.3.5不变