java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing
Add hamcrest-all-X.X.jar to your classpath. Latest version as of Feb 2015 is 1.3: http://code.google.com/p/hamcrest/downloads/detail?name=hamcrest-all-1.3.jar&can=2&q=
Add hamcrest-all-X.X.jar to your classpath. Latest version as of Feb 2015 is 1.3: http://code.google.com/p/hamcrest/downloads/detail?name=hamcrest-all-1.3.jar&can=2&q=
If you’re using maven for managing dependencies, add the following lines in your pom.xml: <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> <version>1.1.1</version> </dependency>
My best bet is there is an issue here: static { //code for loading properties from file } It would appear some uncaught exception occurred and propagated up to the actual ClassLoader attempting to load the class. We would need a stacktrace to confirm this though. Either that or it occurred when creating PropHolder.prop static … Read more
After you compile your code, you end up with .class files for each class in your program. These binary files are the bytecode that Java interprets to execute your program. The NoClassDefFoundError indicates that the classloader (in this case java.net.URLClassLoader), which is responsible for dynamically loading classes, cannot find the .class file for the class … Read more
The difference from the Java API Specifications is as follows. For ClassNotFoundException: Thrown when an application tries to load in a class through its string name using: The forName method in class Class. The findSystemClass method in class ClassLoader. The loadClass method in class ClassLoader. but no definition for the class with the specified name … Read more
While it’s possible that this is due to a classpath mismatch between compile-time and run-time, it’s not necessarily true. It is important to keep two or three different exceptions straight in our head in this case: java.lang.ClassNotFoundException This exception indicates that the class was not found on the classpath. This indicates that we were trying … Read more