Community
Participate
Working Groups
Created attachment 281440 [details] Malformed classpath Under some specific and determined circumstances I cannot understand, Eclipse 2019-12 sets up a malformed test classpath, resulting in a ClassNotFoundException at loading the test class itself. That happens with every test class included in the project. Class not found com.telefonica.bst3.srv.nuc.bank.msg.PojoTest java.lang.ClassNotFoundException: com.telefonica.bst3.srv.nuc.bank.msg.PojoTest at java.net.URLClassLoader.findClass(URLClassLoader.java:382) at java.lang.ClassLoader.loadClass(ClassLoader.java:418) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355) at java.lang.ClassLoader.loadClass(ClassLoader.java:351) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClass(RemoteTestRunner.java:780) I tried to find the root cause, but could not learn too much. It appears to have some relationship with the Maven dependencies I'm including in my pom.xml, because it only happens with some combination of dependencies. However, I couldn't shortlist them; the behavior it's quite random. But maybe the m2e plugin is involved in some way... I tried to debug and found out that the first entry of the test classpath has the current directory and a URL-encoded double quote prefixed on it. As the first entry is "test-classes", that is the reason I'm having the ClassNotFoundException. So the workaround, to make the unit test work, is to patch the classpath with any trivial folder (such as "generated-sources" in the attached screenshot).
*** This bug has been marked as a duplicate of bug 559011 ***