java.lang.IllegalStateException: Could not load TestContextBootstrapper [null]. Specify @BootstrapWi
2017-04-17 17:44
1241 查看
java.lang.IllegalStateException: Could not load TestContextBootstrapper [null]. Specify @BootstrapWith's 'value' attribute or make the default bootstrapper class available. at org.springframework.test.context.BootstrapUtils.resolveTestContextBootstrapper(BootstrapUtils.java:143) at org.springframework.test.context.TestContextManager.<init>(TestContextManager.java:105) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTestContextManager(SpringJUnit4ClassRunner.java:152) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.<init>(SpringJUnit4ClassRunner.java:143) at org.springframework.test.context.junit4.SpringRunner.<init>(SpringRunner.java:49) 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:104) at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86) at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26) at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:33) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:49) at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:51) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:237) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147) Caused by: java.lang.NoSuchMethodError: org.springframework.core.annotation.AnnotatedElementUtils.findAllMergedAnnotations(Ljava/lang/reflect/AnnotatedElement;Ljava/lang/Class;)Ljava/util/Set; at org.springframework.test.context.BootstrapUtils.resolveExplicitTestContextBootstrapper(BootstrapUtils.java:150) at org.springframework.test.context.BootstrapUtils.resolveTestContextBootstrapper(BootstrapUtils.java:126) ... 23 more
错误原因:
在使用spring-test插件执行单元测试时,需要注意的是spring-webmvc的版本应该与spring-test的版本一致,否则在执行junit测试时就会出现“Java.lang.IllegalStateException:
相关文章推荐
- java.lang.IllegalStateException: Could not load TestContextBootstrapper [null]. Specify @BootstrapWi
- java.lang.IllegalStateException: Could not load TestContextBootstrapper [null]. Specify @BootstrapW
- Could not load TestContextBootstrapper [null]. Specify @BootstrapWith's 'val
- java.lang.IllegalStateException: Could not load TestContextBootstrapper [null]. Specify @BootstrapWith's 'value' attribute or make the default bootstrapper class available.
- Could not load TestContextBootstrapper [null]. Specify @BootstrapWith's 'value' attribute
- Tomcat异常:Illegal access: this web application instance has been stopped already. Could not load java.lang.Object.
- java.lang.IllegalStateException: Could not execute method of the activity
- java.lang.IllegalStateException: Could not execute method of the activity
- xfire java.lang.IllegalStateException: Could not initialize Service
- java.lang.IllegalStateException: Could not find a method capture(View) in the activity class
- java.lang.IllegalStateException: Target host must not be null, or set in parameters.
- java.lang.IllegalStateException: Could not auto-size column.
- java.lang.IllegalStateException: Target host must not be null, or set in parameters. scheme=null, ho
- java.lang.IllegalStateException: Could not find a method onStartSingleInstanceActivityClickLisenter(
- Oozie时bin/oozied.sh start或bin/oozied.sh run出现Bootstrap进程无法启动,http://bigdatamaster:11000/oozie界面也无法打开?E0103: Could not load service classes, java.lang.ClassNotFoundException: Class org.apache.oozie.ser
- java.lang.IllegalStateException: Driver for test database type [H2] is not available in the classpat
- java.lang.IllegalStateException: Can not perform this action after onSaveInstance
- java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive
- geotools学习之一:java.lang.IllegalArgumentException: Argument "sourceCRS" should not be null.(未完)
- ubuntu 12.04 x86_64:java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons