Play 2.4 Eclipse and Unit Tests fail with java.lang.ClassNotFoundException

423 views
Skip to first unread message

Gaurav Kalmady

unread,
Oct 14, 2015, 3:44:53 PM10/14/15
to play-framework
Hi,
   I created a new sample play 2.4 application like so https://www.playframework.com/documentation/2.4.x/NewApplication. I want to integrate it with Eclipse (I am using Luna).
I followed the instructions here https://www.playframework.com/documentation/2.4.x/IDE and was able to create a eclipse project for my play app that I imported in to eclipse.
Now when I attempt to run the unit tests I get

Class not found ApplicationTest

java.lang.ClassNotFoundException: ApplicationTest

at java.net.URLClassLoader.findClass(URLClassLoader.java:381)

at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)

at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClass(RemoteTestRunner.java:685)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClasses(RemoteTestRunner.java:421)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:444)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

Class not found IntegrationTest

java.lang.ClassNotFoundException: IntegrationTest

at java.net.URLClassLoader.findClass(URLClassLoader.java:381)

at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)

at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClass(RemoteTestRunner.java:685)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClasses(RemoteTestRunner.java:421)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:444)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)


What am I missing?


Thanks

Gaurav

Gaurav Kalmady

unread,
Oct 14, 2015, 4:05:23 PM10/14/15
to play-framework

A couple of observations.

1. Initially the target/scala-2.11 directory contained only a class directory.
2. I ran the tests on command line via activator test. This succeeded. Also now there is a target/scala-2.11/test-classes directory.
Eclipse continues to fail as described in spite of the newly formed test-classes directory.
3. Now that the test-classes directory is here, I deleted my eclipse project and recreated it using activator eclipse.
The new project too has the same issue.

Thanks
Gaurav
Reply all
Reply to author
Forward
0 new messages