Questions tagged [classnotfoundexception]

The Java exception thrown when an application tries to load a class by name but is not able to find the class.

The Java exception thrown when an application tries to load a class by name. Usually raised by one of:

  • the forName(String) method in class Class
  • the findSystemClass(String) method in class ClassLoader
  • the loadClass(String) method in class ClassLoader

when no definition for the class with the specified name could be found in the .

Don't confuse it with , it's a different kind of error, see the following links for more details:

2104 questions
379
votes
15 answers

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

What is the difference between NoClassDefFoundError and ClassNotFoundException? What causes them to be thrown? How can they be resolved? I often encounter these throwables when modifying existing code to include new jar files. I have hit them on…
krisp
  • 4,617
  • 5
  • 22
  • 25
297
votes
33 answers

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

I included these in the Build Path: all Spring libs Apache Tomcat 7.0 library The project still fails during startup: SEVERE: Error configuring application listener of class…
emeraldhieu
  • 8,982
  • 19
  • 73
  • 135
131
votes
13 answers

Why, Fatal error: Class 'PHPUnit_Framework_TestCase' not found in ...?

Why I'm getting this PHP error? Fatal error: Class 'PHPUnit_Framework_TestCase' not found in ...
Alvin
  • 1,702
  • 4
  • 14
  • 17
117
votes
24 answers

How do I resolve ClassNotFoundException?

I am trying to run a Java application, but getting this error: java.lang.ClassNotFoundException: After the colon comes the location of the class that is missing. However, I know that that location does not exist since the class is located…
user2426316
  • 5,911
  • 18
  • 48
  • 77
83
votes
15 answers

Android Activity ClassNotFoundException - tried everything

I've just refactored an app into a framework library and an application, but now when I try and start the app in the emulator I get the following error stack trace: 06-02 18:22:35.529: E/AndroidRuntime(586): FATAL EXCEPTION: main 06-02 18:22:35.529:…
62
votes
8 answers

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

I've been unable to resolve why this error occurs, and only on a Samsung Tab3 device, running 4.4.2? It happens when my MainActivity starts another Activity, and passes a Parcelable class in the intent like so: private void…
57
votes
26 answers

JUNIT Test class in Eclipse - java.lang.ClassNotFoundException

I'm trying to run my junit test (to verify that a properties file loads correctly) but I get ClassNotFoundException although the class is there and all required libraries are there too. Here it is the error I get : Class not found…
Mouna Cheikhna
  • 35,154
  • 10
  • 46
  • 68
52
votes
25 answers

java.lang.ClassNotFoundException on working app

I have created and published my first Android app. It's very simple. It works fine on simulator and some phones, but I am getting this error: java.lang.RuntimeException: Unable to instantiate application cz.teamnovak.droid.Novak ESC Track guide:…
Skoky
  • 779
  • 1
  • 8
  • 15
50
votes
9 answers

org.glassfish.jersey.servlet.ServletContainer ClassNotFoundException

I have been getting a ClassNotFoundException with org.glassfish.jersey.servlet.ServletContainer but it peculiarly started last night when I tried to start/re-start my Tomcat server (v7) with Eclipse Juno. Not sure what is going on. What's bizarre…
ssankara73
  • 623
  • 1
  • 5
  • 6
49
votes
8 answers

java.lang.ClassNotFoundException: javax.servlet.jsp.jstl.core.Config

When I am run my application after entering the URL, this exception is coming.I am using Eclipse and Tomcat7.0.35. I also added Jstl.jar and jstl1.2.jar My code is java.lang.ClassNotFoundException: javax.servlet.jsp.jstl.core.Config at…
Ssv
  • 1,009
  • 4
  • 13
  • 24
44
votes
13 answers

Android ClassNotFoundException: Didn't find class on path

I can't find the solution of this error. Can you please give the permanent solution? I have no idea how to solve it. 01-04 11:06:42.302: E/AndroidRuntime(1906): java.lang.RuntimeException: Unable to instantiate activity…
user3129072
  • 455
  • 1
  • 4
  • 7
43
votes
6 answers

Java ClassNotFoundException with maven dependency

I am getting ClassNotFoundException and NoClassDefFoundError exceptions when I attempt to run my application using a maven defined dependency. I added my maven dependency for the jar in question to my pom.xml file with the following…
Vex
  • 1,089
  • 3
  • 15
  • 24
42
votes
2 answers

ClassNotFoundException when using User Libraries in Eclipse build path

I'm using Eclipse 3.7 (STS) with Tomcat 7 running inside the IDE. I've created a new Dynamic Web project and added a single JSP file to the web content root folder. I can run Tomcat and access the JSP from within Eclipse with no problems. I've added…
user646584
  • 2,961
  • 5
  • 23
  • 26
39
votes
3 answers

How to use clojure doc function?

I'm just starting with Clojure and can't access to the doc function. I'm using clojure 1.3 with emacs24 and swank-clojure. user> *clojure-version* {:major 1, :minor 3, :incremental 0, :qualifier nil} But when I try: (doc doc) I get: Unable to…
zaforas
  • 393
  • 3
  • 6
39
votes
7 answers

Resolving dependency problems in Apache Spark

The common problems when building and deploying Spark applications are: java.lang.ClassNotFoundException. object x is not a member of package y compilation errors. java.lang.NoSuchMethodError How these can be resolved?
1
2 3
99 100