JMeter seems to expect a lot of the constructors of the JUnit test class, e.g. the standard constructor, a constructor with just a String argument and all libraries that are used within the constructor (e.g. someone uses jlog inside the constructor, the jlog-library has to be provided). While all these requirements are reasonable, the error message is not. In all those cases the only message is “failed to create an instance of the class”, which gives no hint or help what is wrong or missing. If an error occurrs in the Java code outside of the constructor, the messages are very expressive, so it would be nice to get the same detail also with problems that occur in the constructor of the JUnit test class.
Date: Sun Apr 28 13:55:43 2013 New Revision: 1476768 URL: http://svn.apache.org/r1476768 Log: Bug 54896 - JUnit sampler gives only “failed to create an instance of the class” message with constructor problems Bugzilla Id: 54896 Modified: jmeter/trunk/src/junit/org/apache/jmeter/protocol/java/sampler/JUnitSampler.java jmeter/trunk/xdocs/changes.xml
We clarified failure. Feel free to download nightly build and give us some feedback.
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/3109