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

表示很绝望啊 有没有人解决下

"C:\Program Files (x86)\Java\jdk1.8.0_131\bin\java" -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:60439,suspend=y,server=n -ea -Didea.test.cyclic.buffer.size=1048576 -Dfile.encoding=UTF-8 -classpath "D:\appAppPath\IntelliJ IDEA Community Edition 2017.1.3\lib\idea_rt.jar;D:\appAppPath\IntelliJ IDEA Community Edition 2017.1.3\plugins\junit\lib\junit-rt.jar;C:\Program Files (x86)\Java\jdk1.8.0_131\jre\lib\charsets.jar;C:\Program Files (x86)\Java\jdk1.8.0_131\jre\lib\deploy.jar;C:\Program Files (x86)\Java\jdk1.8.0_131\jre\lib\ext\access-bridge-32.jar;C:\Program Files (x86)\Java\jdk1.8.0_131\jre\lib\ext\cldrdata.jar;C:\Program Files (x86)\Java\jdk1.8.0_131\jre\lib\ext\dnsns.jar;C:\Program Files (x86)\Java\jdk1.8.0_131\jre\lib\ext\jaccess.jar;C:\Program Files (x86)\Java\jdk1.8.0_131\jre\lib\ext\jfxrt.jar;C:\Program Files (x86)\Java\jdk1.8.0_131\jre\lib\ext\localedata.jar;C:\Program Files (x86)\Java\jdk1.8.0_131\jre\lib\ext\nashorn.jar;C:\Program Files (x86)\Java\jdk1.8.0_131\jre\lib\ext\sunec.jar;C:\Program Files (x86)\Java\jdk1.8.0_131\jre\lib\ext\sunjce_provider.jar;C:\Program Files (x86)\Java\jdk1.8.0_131\jre\lib\ext\sunmscapi.jar;C:\Program Files (x86)\Java\jdk1.8.0_131\jre\lib\ext\sunpkcs11.jar;C:\Program Files (x86)\Java\jdk1.8.0_131\jre\lib\ext\zipfs.jar;C:\Program Files (x86)\Java\jdk1.8.0_131\jre\lib\javaws.jar;C:\Program Files (x86)\Java\jdk1.8.0_131\jre\lib\jce.jar;C:\Program Files (x86)\Java\jdk1.8.0_131\jre\lib\jfr.jar;C:\Program Files (x86)\Java\jdk1.8.0_131\jre\lib\jfxswt.jar;C:\Program Files (x86)\Java\jdk1.8.0_131\jre\lib\jsse.jar;C:\Program Files (x86)\Java\jdk1.8.0_131\jre\lib\management-agent.jar;C:\Program Files (x86)\Java\jdk1.8.0_131\jre\lib\plugin.jar;C:\Program Files (x86)\Java\jdk1.8.0_131\jre\lib\resources.jar;C:\Program Files (x86)\Java\jdk1.8.0_131\jre\lib\rt.jar;C:\Users\tieminPan\seckill\target\test-classes;C:\Users\tieminPan\seckill\target\classes;C:\Users\tieminPan\.m2\repository\junit\junit\4.5\junit-4.5.jar;C:\Users\tieminPan\.m2\repository\org\slf4j\slf4j-api\1.7.5\slf4j-api-1.7.5.jar;C:\Users\tieminPan\.m2\repository\mysql\mysql-connector-java\5.1.35\mysql-connector-java-5.1.35.jar;C:\Users\tieminPan\.m2\repository\c3p0\c3p0\0.9.1.2\c3p0-0.9.1.2.jar;C:\Users\tieminPan\.m2\repository\org\mybatis\mybatis\3.4.5\mybatis-3.4.5.jar;C:\Users\tieminPan\.m2\repository\org\mybatis\mybatis-spring\1.2.3\mybatis-spring-1.2.3.jar;C:\Users\tieminPan\.m2\repository\taglibs\standard\1.1.2\standard-1.1.2.jar;C:\Users\tieminPan\.m2\repository\jstl\jstl\1.2\jstl-1.2.jar;C:\Users\tieminPan\.m2\repository\com\fasterxml\jackson\core\jackson-databind\2.5.4\jackson-databind-2.5.4.jar;C:\Users\tieminPan\.m2\repository\com\fasterxml\jackson\core\jackson-annotations\2.5.0\jackson-annotations-2.5.0.jar;C:\Users\tieminPan\.m2\repository\com\fasterxml\jackson\core\jackson-core\2.5.4\jackson-core-2.5.4.jar;C:\Users\tieminPan\.m2\repository\javax\servlet\javax.servlet-api\3.1.0\javax.servlet-api-3.1.0.jar;C:\Users\tieminPan\.m2\repository\org\springframework\spring-core\4.1.7.RELEASE\spring-core-4.1.7.RELEASE.jar;C:\Users\tieminPan\.m2\repository\commons-logging\commons-logging\1.2\commons-logging-1.2.jar;C:\Users\tieminPan\.m2\repository\org\springframework\spring-beans\4.1.7.RELEASE\spring-beans-4.1.7.RELEASE.jar;C:\Users\tieminPan\.m2\repository\org\springframework\spring-context\4.1.7.RELEASE\spring-context-4.1.7.RELEASE.jar;C:\Users\tieminPan\.m2\repository\org\springframework\spring-aop\4.1.7.RELEASE\spring-aop-4.1.7.RELEASE.jar;C:\Users\tieminPan\.m2\repository\aopalliance\aopalliance\1.0\aopalliance-1.0.jar;C:\Users\tieminPan\.m2\repository\org\springframework\spring-expression\4.1.7.RELEASE\spring-expression-4.1.7.RELEASE.jar;C:\Users\tieminPan\.m2\repository\org\springframework\spring-jdbc\4.1.7.RELEASE\spring-jdbc-4.1.7.RELEASE.jar;C:\Users\tieminPan\.m2\repository\org\springframework\spring-tx\4.1.7.RELEASE\spring-tx-4.1.7.RELEASE.jar;C:\Users\tieminPan\.m2\repository\org\springframework\spring-web\4.1.7.RELEASE\spring-web-4.1.7.RELEASE.jar;C:\Users\tieminPan\.m2\repository\org\springframework\spring-webmvc\4.1.7.RELEASE\spring-webmvc-4.1.7.RELEASE.jar;C:\Users\tieminPan\.m2\repository\org\springframework\spring-test\4.1.7.RELEASE\spring-test-4.1.7.RELEASE.jar" com.intellij.rt.execution.junit.JUnitStarter -ideVersion5 org.seckill.dao.SeckillDaoTest,queryById

Connected to the target VM, address: '127.0.0.1:60439', transport: 'socket'


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)

at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:24)

at org.junit.internal.requests.FilterRequest.getRunner(FilterRequest.java:34)

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:242)

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

Caused by: java.lang.IllegalStateException: Failed to find withRules() method: SpringJUnit4ClassRunner requires JUnit 4.9 or higher.

at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.<clinit>(SpringJUnit4ClassRunner.java:94)

... 15 more


Disconnected from the target VM, address: '127.0.0.1:60439', transport: 'socket'


Process finished with exit code -1


正在回答

5 回答

专门来看的,一下午了,解决了吗问题


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

娃娃胖兜兜 提问者

非常感谢!
2018-01-06 回复 有任何疑惑可以回复我~

楼主能说一下怎么解决的吗

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

这个问题解决了吗 同样问题啊

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

娃娃胖兜兜 提问者

解决了 现在别人的项目一个一个对应处理 好像就没什么问题了
2018-01-06 回复 有任何疑惑可以回复我~
  1. juint 使用4.12。

  2. 还有,你去看看你的pom是不是没配置spring整合junit的包叫:spring-test的依赖包

  3. 看看spring这些依赖包是不是一致;

  4. 看看spring核心包在不在。



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

把你的测试代码亮出来

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

举报

0/150
提交
取消

表示很绝望啊 有没有人解决下

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