Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » ClassNotFoundException when running JUnit test(ClassNotFoundException when running JUnit test)
ClassNotFoundException when running JUnit test [message #903319] Thu, 23 August 2012 07:18 Go to next message
Kris Ram is currently offline Kris RamFriend
Messages: 11
Registered: July 2012
Junior Member
Hi guys,

I have a maven project and I have imported it into Eclipse.

I have successfuly run a few unit tests before, but after a few maven builds on the command line and then refresing on eclipse, I get a failure.

Class not found
	at java.lang.ClassLoader.loadClass(
	at sun.misc.Launcher$AppClassLoader.loadClass(
	at java.lang.ClassLoader.loadClass(
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClass(
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClasses(
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(

Where in Eclipse, do I start to investigate what is wrong? And if you know how to solve it permanently it would be great.

I know I can get this to work by cleaning, rebuilding, etc...

Re: ClassNotFoundException when running JUnit test [message #903370 is a reply to message #903319] Thu, 23 August 2012 11:37 Go to previous message
Kris Ram is currently offline Kris RamFriend
Messages: 11
Registered: July 2012
Junior Member
I imported the project in STS 2.6.0 and ran the test again and it worked.

I noticed one difference, in the target folder the are 2 folders; classes and test-classes.

Previously the test-classes folder was not populated and it now contains all the test classes.

I can't confirm why it is generated now and not before though.

Hope somebody has some answers.

Previous Topic:cannot resolve
Next Topic:Debugging not working while running works
Goto Forum:

Current Time: Thu Jan 20 12:07:00 GMT 2022

Powered by FUDForum. Page generated in 0.03245 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top