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:

2221 questions
12
votes
3 answers

Serializable class not available to broker: java.lang.ClassNotFoundException while viewing messages in ActiveMQ

I want to see content of message which have been queued in ActiveMQ queues. I opened web-console.(http://localhost:8161/admin/queues.jsp) and clicked on message-id of the message of queue. It gives me following error in "Message Details" window…
OwlR
  • 409
  • 1
  • 5
  • 19
12
votes
4 answers

ClassNotFoundException - com.microsoft.jdbc.sqlserver.SQLServerDriver

I have a web development project using local install of Tomcat 7. I am trying to connect to SQL Server 2012 using Microsoft's driver for jdbc (sqljdbc41.jar). The sqljdbc41.jar is in my application build path: and I am exporting it. Furthermore,…
Roy Hinkley
  • 10,111
  • 21
  • 80
  • 120
12
votes
17 answers

Android Studio: ClassNotFoundException

i was busy with my app for over a week, when suddenly: 11-12 07:59:17.860 1653-1653/nl.test.myapp E/AndroidRuntime﹕ FATAL EXCEPTION: main java.lang.RuntimeException: Unable to instantiate activity…
patrick
  • 361
  • 1
  • 3
  • 14
12
votes
3 answers

Reason for ClassNotFoundException to be a checked exception

What is the reason behind ClassNotFoundException being a checked exception? I've been guessing and googling trying to understand why consider class not found as checked exception, because all my mind tells me that it should be unchecked.
Rafael
  • 2,521
  • 2
  • 33
  • 59
12
votes
10 answers

HTTP Status 500 - Error instantiating servlet class pkg.coreServlet

I am creating simple servlet and deploying it in tomcat server but I am getting the following error: HTTP Status 500 - Error instantiating servlet class pkg.coreServlet File Structure on the tomcat server: webapps | - aarya | - WEB-INF …
Anshul
  • 9,312
  • 11
  • 57
  • 74
11
votes
3 answers

Java class execution problem: java.lang.ClassNotFoundException

Below is what I tried in linux terminal: compiled Test.java, run Test.class, and got an error. Then, I tried the same command with "-classpath ." option and "-cp ." option, but also failed. /testpackage$ cat Test.java package testpackage; public…
David Johns
  • 1,201
  • 5
  • 15
  • 34
11
votes
9 answers

android.support.v4.content.FileProvider class not found in android Kitkat

I am using FileProvider in my app. As usual I declared tag in AndroidManifest.xml file as below.
11
votes
1 answer

ClassNotFoundException even though the jar containing the class is properly present in the classpath

I'm configuring a new project in eclipse. my project has many modules including one of them named eas.core. to the buildPath of my eas.core module, i have added a jar file common.jcr.jar containing a class named ContentRepositorySettings, that I'm…
blaiso
  • 347
  • 4
  • 6
  • 15
11
votes
5 answers

java.lang.ClassNotFoundException for a specified class

In my main I have the following statement Class booki = Class.forName("Book"); which throws a java.lang.ClassNotFoundException exception when I use the full path like Class booki = Class.forName("javatests.Book"); it is ok. The main class and the…
Avraam Mavridis
  • 8,698
  • 19
  • 79
  • 133
11
votes
9 answers

oracle.jdbc.driver.OracleDriver ClassNotFoundException

This is my code for which I am getting error. My classes12.jar has been imported as an external jar. import java.io.IOException; import java.io.PrintWriter; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import…
Mavrick
  • 505
  • 1
  • 7
  • 27
11
votes
4 answers

ClassNotFoundException after upgrading to ADT 18

Since I updated ADT to 19, I started to get following error. The problem happens whenever I start my apps. I checked all the previous post related to this, but it seems none of them helps. any idea would be GREATLY appreciated... My setup I…
ChrsitopherJ
  • 131
  • 1
  • 5
10
votes
4 answers

ClassNotFoundException for android.view.Space when running application

I'm having an issue running my application when certain elements exist in the layout of my activity. I have the following layout, and I have issue when I include the "Space" element:
Christian
  • 799
  • 7
  • 15
10
votes
2 answers

Android Annotations framework doesn't seem to generate anything

I'm trying to use Android annotations framework because it seems quite powerful. I'm quite stuck to configuring my first project based on it. I followed every step of the wiki but it doesn't generate any file after a build. So when I ask for a…
10
votes
4 answers

java.lang.ClassNotFoundException: org.apache.catalina.core.ThreadLocalLeakPreventionListener

I'm trying to create a web service and deply it on Tomcat. I'm following this tutorial. I'm using Eclipse Europa. But when I try to start the server it returns this error: java.lang.ClassNotFoundException:…
rogcg
  • 10,451
  • 20
  • 91
  • 133
10
votes
2 answers

java ClassNotFoundException LoggerFactory when setting Quartz up

So I'm using the Quartz jar: quartz-all-2.0.1.jar. From the readme, that jar is supposed to have everything set up. However, when I try to create a SchedulerFactory using SchedulerFactory sf = new StdSchedulerFactory(); I get this: Exception in…
Kevin
  • 1,080
  • 3
  • 15
  • 41