JUNIT Test class in Eclipse – java.lang.ClassNotFoundException

ConfigurationManagerTest is not being found on your classpath. Ensure that the ConfigurationManagerTest.class file is available on your classpath. It might not exist if it wasn’t successfully compiled or if it’s being created in a directory that you haven’t told the Eclipse project should be on the classpath. Assuming that you’ve put your test classes in … Read more

Android E/Parcel﹕ Class not found when unmarshalling (only on Samsung Tab3)

For some strange reason it looks like the class loader isn’t set up properly. Try one of the following in TestActivity.onCreate(): TestParcel cfgOptions = getIntent().getParcelableExtra(“cfgOptions”); Intent intent = getIntent(); intent.setExtrasClassLoader(TestParcel.class.getClassLoader()); TestParcel cfgOptions = intent.getParcelableExtra(“cfgOptions”); Bundle extras = getIntent().getExtras(); extras.setClassLoader(TestParcel.class.getClassLoader()); TestParcel cfgOptions = extras.getParcelable(“cfgOptions”); Alternatively, wrap the parcelable into a bundle: Bundle b = new Bundle(); … Read more

java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener

I had a similar problem when running a spring web application in an Eclipse managed tomcat. I solved this problem by adding maven dependencies in the project’s web deployment assembly. Open the project’s properties (e.g., right-click on the project’s name in the project explorer and select “Properties”). Select “Deployment Assembly”. Click the “Add…” button on … Read more

What causes and what are the differences between NoClassDefFoundError and ClassNotFoundException?

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