简体   繁体   English

找不到现有的JUnit类异常

[英]Existing JUnit Class not found exception

I am trying to run a test from XSDGeneratorTest.java. 我正在尝试从XSDGeneratorTest.java运行测试。 But I get the following exception: 但是我得到以下异常:

Class not found com.level3.pcat.xsd.XSDGeneratorTest
java.lang.ClassNotFoundException: com.level3.pcat.xsd.XSDGeneratorTest
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at     org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClass(RemoteTestRunner.java:693)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClasses(RemoteTestRunner.java:429)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

I tried to claen and build the project many a times but still same error! 我试图争取和建立项目很多次,但仍然是同样的错误! I tried all the options from JUNIT Test class in Eclipse - java.lang.ClassNotFoundException , but none worked for me! 我尝试了Eclipse中JUNIT Test类的所有选项-java.lang.ClassNotFoundException ,但是没有一个对我有用

If that happens when you moved your project from one IDE/OS to another, just try to remove the JUnit3 library and add it again. 如果在将项目从一个IDE / OS迁移到另一个IDE / OS时发生这种情况,只需尝试删除JUnit3库并再次添加即可。 Sometimes that fails when you bring your proyect from outside. 有时,当您从外部带来您的proyect时,它会失败。 I was stuck getting the same error until I did that. 在这样做之前,我一直遇到同样的错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM