The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

Denethon (1) [Avatar] Offline
#1
Hi

I just purchased your book and downloaded the source code for the chapters.

I've imported the code examples into my eclipse workspace as described in appendix C and D, but for some reason theres a red cross indicating an error on each project in my package explorer. I've tried expanding every item in the folder/file structure to find the source of error, but there's no indication on whats wrong.

When trying to run the JUnit test by selecting the project and clicking "Runs as" "JUnit Test" i get a eclipse dialog saying "Errors exist in required project(s)".

If i click "Proceed" it starts running but goes soon to a halt with a exception for each test in the test suite:

Class not found com.manning.junitbook.ch03.mastering.TestDefaultController
java.lang.ClassNotFoundException: com.manning.junitbook.ch03.mastering.TestDefaultController
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:24smilie
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)
Class not found com.manning.junitbook.ch03.mastering.HamcrestTest

Any idea how to fix this? I'm happy for any help in the right direction, since I'm quite new both in java and in JUnit.

Thank you!

Message was edited by:
Denethon
Meng (2) [Avatar] Offline
#2
Re: Problem building code examples in eclipse
I meet same issues.
If you know how to resolve it, please let us know.