Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Classload.load and Class.forName question

807588Aug 10 2007 — edited Apr 27 2009
I know there are several threads about this, but I have a doubt.

I'm getting a ClassNotFoundException running the JUnitSampler of JMeter.
This test is run by maven (using a specific plugin for it). This plugin creates a new Thread to call JMeter with all the parameters that needs.

The class that the JUnitSampler is trying to run is in the classpath (is not jar).
I know this because I run maven with -X parameter and it shows this:
[DEBUG] Test Classpath :
[DEBUG]   /path/to/project/target/classes
[DEBUG]   /path/to/project/target/test-classes
Looking at JUnitSampler code I can see this
theclazz = Thread.currentThread().getContextClassLoader().loadClass(className.trim());
Is there any reason that the class couldn't be found?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 25 2009
Added on Aug 10 2007
18 comments
403 views