为了账号安全,请及时绑定邮箱和手机立即绑定

老师运行测试案例的时候报这错误?不知道怎么解决。

"C:\Program Files\Java\jdk1.8.0_131\bin\java" -ea -Didea.test.cyclic.buffer.size=1048576 "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2017.3.4\lib\idea_rt.jar=56403:C:\Program Files\JetBrains\IntelliJ IDEA 2017.3.4\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\JetBrains\IntelliJ IDEA 2017.3.4\lib\idea_rt.jar;C:\Program Files\JetBrains\IntelliJ IDEA 2017.3.4\plugins\junit\lib\junit-rt.jar;C:\Program Files\JetBrains\IntelliJ IDEA 2017.3.4\plugins\junit\lib\junit5-rt.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\rt.jar;E:\first\target\test-classes;E:\first\target\classes;E:\maven-3.6.0\repository\org\springframework\boot\spring-boot-starter\2.1.6.RELEASE\spring-boot-starter-2.1.6.RELEASE.jar;E:\maven-3.6.0\repository\org\springframework\boot\spring-boot\2.1.6.RELEASE\spring-boot-2.1.6.RELEASE.jar;E:\maven-3.6.0\repository\org\springframework\spring-context\5.1.8.RELEASE\spring-context-5.1.8.RELEASE.jar;E:\maven-3.6.0\repository\org\springframework\spring-aop\5.1.8.RELEASE\spring-aop-5.1.8.RELEASE.jar;E:\maven-3.6.0\repository\org\springframework\spring-beans\5.1.8.RELEASE\spring-beans-5.1.8.RELEASE.jar;E:\maven-3.6.0\repository\org\springframework\spring-expression\5.1.8.RELEASE\spring-expression-5.1.8.RELEASE.jar;E:\maven-3.6.0\repository\org\springframework\boot\spring-boot-autoconfigure\2.1.6.RELEASE\spring-boot-autoconfigure-2.1.6.RELEASE.jar;E:\maven-3.6.0\repository\org\springframework\boot\spring-boot-starter-logging\2.1.6.RELEASE\spring-boot-starter-logging-2.1.6.RELEASE.jar;E:\maven-3.6.0\repository\ch\qos\logback\logback-classic\1.2.3\logback-classic-1.2.3.jar;E:\maven-3.6.0\repository\ch\qos\logback\logback-core\1.2.3\logback-core-1.2.3.jar;E:\maven-3.6.0\repository\org\apache\logging\log4j\log4j-to-slf4j\2.11.2\log4j-to-slf4j-2.11.2.jar;E:\maven-3.6.0\repository\org\apache\logging\log4j\log4j-api\2.11.2\log4j-api-2.11.2.jar;E:\maven-3.6.0\repository\org\slf4j\jul-to-slf4j\1.7.26\jul-to-slf4j-1.7.26.jar;E:\maven-3.6.0\repository\javax\annotation\javax.annotation-api\1.3.2\javax.annotation-api-1.3.2.jar;E:\maven-3.6.0\repository\org\springframework\spring-core\5.1.8.RELEASE\spring-core-5.1.8.RELEASE.jar;E:\maven-3.6.0\repository\org\springframework\spring-jcl\5.1.8.RELEASE\spring-jcl-5.1.8.RELEASE.jar;E:\maven-3.6.0\repository\org\yaml\snakeyaml\1.23\snakeyaml-1.23.jar;E:\maven-3.6.0\repository\org\springframework\boot\spring-boot-starter-test\2.1.6.RELEASE\spring-boot-starter-test-2.1.6.RELEASE.jar;E:\maven-3.6.0\repository\org\springframework\boot\spring-boot-test\2.1.6.RELEASE\spring-boot-test-2.1.6.RELEASE.jar;E:\maven-3.6.0\repository\org\springframework\boot\spring-boot-test-autoconfigure\2.1.6.RELEASE\spring-boot-test-autoconfigure-2.1.6.RELEASE.jar;E:\maven-3.6.0\repository\com\jayway\jsonpath\json-path\2.4.0\json-path-2.4.0.jar;E:\maven-3.6.0\repository\net\minidev\json-smart\2.3\json-smart-2.3.jar;E:\maven-3.6.0\repository\net\minidev\accessors-smart\1.2\accessors-smart-1.2.jar;E:\maven-3.6.0\repository\org\ow2\asm\asm\5.0.4\asm-5.0.4.jar;E:\maven-3.6.0\repository\org\slf4j\slf4j-api\1.7.26\slf4j-api-1.7.26.jar;E:\maven-3.6.0\repository\junit\junit\4.12\junit-4.12.jar;E:\maven-3.6.0\repository\org\assertj\assertj-core\3.11.1\assertj-core-3.11.1.jar;E:\maven-3.6.0\repository\org\mockito\mockito-core\2.23.4\mockito-core-2.23.4.jar;E:\maven-3.6.0\repository\net\bytebuddy\byte-buddy\1.9.13\byte-buddy-1.9.13.jar;E:\maven-3.6.0\repository\net\bytebuddy\byte-buddy-agent\1.9.13\byte-buddy-agent-1.9.13.jar;E:\maven-3.6.0\repository\org\objenesis\objenesis\2.6\objenesis-2.6.jar;E:\maven-3.6.0\repository\org\hamcrest\hamcrest-core\1.3\hamcrest-core-1.3.jar;E:\maven-3.6.0\repository\org\hamcrest\hamcrest-library\1.3\hamcrest-library-1.3.jar;E:\maven-3.6.0\repository\org\skyscreamer\jsonassert\1.5.0\jsonassert-1.5.0.jar;E:\maven-3.6.0\repository\com\vaadin\external\google\android-json\0.0.20131108.vaadin1\android-json-0.0.20131108.vaadin1.jar;E:\maven-3.6.0\repository\org\xmlunit\xmlunit-core\2.6.2\xmlunit-core-2.6.2.jar;E:\maven-3.6.0\repository\org\projectlombok\lombok\1.18.8\lombok-1.18.8.jar;E:\maven-3.6.0\repository\com\baomidou\mybatis-plus-extension\3.0.5\mybatis-plus-extension-3.0.5.jar;E:\maven-3.6.0\repository\com\baomidou\mybatis-plus-core\3.0.5\mybatis-plus-core-3.0.5.jar;E:\maven-3.6.0\repository\com\baomidou\mybatis-plus-annotation\3.0.5\mybatis-plus-annotation-3.0.5.jar;E:\maven-3.6.0\repository\com\github\jsqlparser\jsqlparser\1.2\jsqlparser-1.2.jar;E:\maven-3.6.0\repository\org\mybatis\mybatis-spring\1.3.2\mybatis-spring-1.3.2.jar;E:\maven-3.6.0\repository\org\mybatis\mybatis\3.4.6\mybatis-3.4.6.jar;E:\maven-3.6.0\repository\com\baomidou\mybatis-plus-generator\3.0.5\mybatis-plus-generator-3.0.5.jar;E:\maven-3.6.0\repository\mysql\mysql-connector-java\8.0.15\mysql-connector-java-8.0.15.jar;E:\maven-3.6.0\repository\org\springframework\spring-test\5.1.8.RELEASE\spring-test-5.1.8.RELEASE.jar" com.intellij.rt.execution.junit.JUnitStarter -ideVersion5 -junit4 com.mp.SimpleTest,select

15:08:43.425 [main] DEBUG org.springframework.test.context.junit4.SpringJUnit4ClassRunner - SpringJUnit4ClassRunner constructor called with [class com.mp.SimpleTest]

15:08:43.434 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating CacheAwareContextLoaderDelegate from class [org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate]

15:08:43.450 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating BootstrapContext using constructor [public org.springframework.test.context.support.DefaultBootstrapContext(java.lang.Class,org.springframework.test.context.CacheAwareContextLoaderDelegate)]

15:08:43.484 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating TestContextBootstrapper for test class [com.mp.SimpleTest] from class [org.springframework.boot.test.context.SpringBootTestContextBootstrapper]

15:08:43.510 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Neither @ContextConfiguration nor @ContextHierarchy found for test class [com.mp.SimpleTest], using SpringBootContextLoader

15:08:43.516 [main] DEBUG org.springframework.test.context.support.AbstractContextLoader - Did not detect default resource location for test class [com.mp.SimpleTest]: class path resource [com/mp/SimpleTest-context.xml] does not exist

15:08:43.517 [main] DEBUG org.springframework.test.context.support.AbstractContextLoader - Did not detect default resource location for test class [com.mp.SimpleTest]: class path resource [com/mp/SimpleTestContext.groovy] does not exist

15:08:43.517 [main] INFO org.springframework.test.context.support.AbstractContextLoader - Could not detect default resource locations for test class [com.mp.SimpleTest]: no resource found for suffixes {-context.xml, Context.groovy}.

15:08:43.586 [main] DEBUG org.springframework.test.context.support.ActiveProfilesUtils - Could not find an 'annotation declaring class' for annotation type [org.springframework.test.context.ActiveProfiles] and class [com.mp.SimpleTest]

java.lang.annotation.AnnotationFormatError: Invalid default: public abstract java.lang.Class org.mybatis.spring.annotation.MapperScan.factoryBean()


at java.lang.reflect.Method.getDefaultValue(Method.java:612)

at sun.reflect.annotation.AnnotationType.<init>(AnnotationType.java:132)

at sun.reflect.annotation.AnnotationType.getInstance(AnnotationType.java:85)

at sun.reflect.annotation.AnnotationParser.parseAnnotation2(AnnotationParser.java:266)

at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:120)

at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:72)

at java.lang.Class.createAnnotationData(Class.java:3521)

at java.lang.Class.annotationData(Class.java:3510)

at java.lang.Class.getAnnotation(Class.java:3415)

at java.lang.reflect.AnnotatedElement.isAnnotationPresent(AnnotatedElement.java:258)

at java.lang.Class.isAnnotationPresent(Class.java:3425)

at org.springframework.core.annotation.AnnotatedElementUtils.isAnnotated(AnnotatedElementUtils.java:261)

at org.springframework.boot.test.context.SpringBootTestContextBootstrapper.containsNonTestComponent(SpringBootTestContextBootstrapper.java:241)

at org.springframework.boot.test.context.SpringBootTestContextBootstrapper.getOrFindConfigurationClasses(SpringBootTestContextBootstrapper.java:228)

at org.springframework.boot.test.context.SpringBootTestContextBootstrapper.processMergedContextConfiguration(SpringBootTestContextBootstrapper.java:149)

at org.springframework.test.context.support.AbstractTestContextBootstrapper.buildMergedContextConfiguration(AbstractTestContextBootstrapper.java:395)

at org.springframework.test.context.support.AbstractTestContextBootstrapper.buildDefaultMergedContextConfiguration(AbstractTestContextBootstrapper.java:312)

at org.springframework.test.context.support.AbstractTestContextBootstrapper.buildMergedContextConfiguration(AbstractTestContextBootstrapper.java:265)

at org.springframework.test.context.support.AbstractTestContextBootstrapper.buildTestContext(AbstractTestContextBootstrapper.java:108)

at org.springframework.boot.test.context.SpringBootTestContextBootstrapper.buildTestContext(SpringBootTestContextBootstrapper.java:98)

at org.springframework.test.context.TestContextManager.<init>(TestContextManager.java:139)

at org.springframework.test.context.TestContextManager.<init>(TestContextManager.java:124)

at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTestContextManager(SpringJUnit4ClassRunner.java:151)

at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.<init>(SpringJUnit4ClassRunner.java:142)

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 org.junit.internal.requests.FilterRequest.getRunner(FilterRequest.java:36)

at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:49)

at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)

at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)

at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)



Process finished with exit code -1



正在回答

1 回答

额,同学,光看这个报错信息,我也找不到原因。要是你方便的话,可以把程序传到百度网盘或者gitee上,地址发给我,我帮你调调。

0 回复 有任何疑惑可以回复我~
#1

lin3741160 提问者

老师能把你这项目的代码共享下吗?我用idea和Eclipse都有问题..
2019-07-14 回复 有任何疑惑可以回复我~
#2

老猿 回复 lin3741160 提问者

抱歉,网站规定,免费课程不提供源代码。但是有的同学,已经把自己写的例子上传到gitee上了,你可以在留言区和评论去找找。看看能否解决你的问题。
2019-07-15 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

老师运行测试案例的时候报这错误?不知道怎么解决。

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信