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
14
votes
3 answers

java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

I am getting this error when compiling my java program java.lang.ClassNotFoundException: com.mysql.jdbc.Driver Then I knew that I should add the path of mysql-connector-java-3.1.14-bin.jar to the java classpath. I am using Windows XP, I edited the…
SLA
  • 363
  • 2
  • 4
  • 11
14
votes
4 answers

NoClassDefFoundError for OkHttpClient

After adding the facebook dependency in gradle I'm getting this runtime error: compile 'com.facebook.android:facebook-android-sdk:4.6.0' Please notice that I'm also using okhttp: compile 'com.squareup.okhttp:okhttp:2.5.0' and error log…
Venkat
  • 3,447
  • 6
  • 42
  • 61
14
votes
5 answers

Android "java.lang.RuntimeException: Parcelable encounteredClassNotFoundException reading a Serializable object"

I have an Android application in which I add one more enum: public enum RootNavigationOption { HOME(R.string.home, R.drawable.ic_home), SETTINGS(R.string.settings, R.drawable.ic_settings), LOGOUT( R.string.logout_label,…
Boris Strandjev
  • 46,145
  • 15
  • 108
  • 135
14
votes
2 answers

ProGuard breaks JavaFX application

I'm trying to obfuscate my JavaFX application but it fails. The generated result does not work and I do not understand why. The resulting jar just fails because the fxml file cannot load all imports anymore (ClassNotFoundException). The Deployment…
Crine
  • 805
  • 7
  • 24
14
votes
9 answers

java.lang.ClassNotFoundException: javax.faces.webapp.FacesServlet

I am getting this error, when executing JSF and PrimeFaces. I have included these jars, jsf-api-2.0.3.jar, jsf-impl-2.0.3.jar , jstl-1.0.2.jar jars and primefaces-2.2.RC2.jar in the WEB-INF/lib folder. Is there any jar I am missing?
Mohan Raj
  • 590
  • 3
  • 8
  • 22
14
votes
2 answers

Groovy - class not found

The following Groovy script fails with a java.lang.ClassNotFoundException: com.mysql.jdbc.Driver exception. @Grapes([ @Grab('mysql:mysql-connector-java:5.1.25') ]) import groovy.sql.Sql def sql = Sql.newInstance( …
Dušan Rychnovský
  • 11,699
  • 8
  • 41
  • 65
14
votes
7 answers

java.lang.ClassNotFoundException for servlet in tomcat with eclipse

I am starting to develop a java web application in eclipse using servlets and am testing it with tomcat server on my localhost. I have deployed the application in tomcat, but when I try to load the target url in my browser, I get the following stack…
CodeMed
  • 9,527
  • 70
  • 212
  • 364
14
votes
5 answers

ClassNotFoundException on AndroidAnnotations generated classes since update to ADT 22

This project worked wonders before updating to ADT22. I already lost a day because of not knowing I had to download build tools, and I'm afraid I'm going to loose another one because of this. When I try to build the same code that was working two…
14
votes
10 answers

java.lang.RuntimeException: Unable to instantiate activity ComponentInfo/ ClassNotFoundException

I'm develop android application and than i wanna additional new Activity i had error on my logcat My LogCat: 04-19 12:59:17.654: D/AndroidRuntime(18135): Shutting down VM 04-19 12:59:17.654: W/dalvikvm(18135): threadid=1: thread exiting with…
a.black13
  • 2,157
  • 4
  • 19
  • 20
14
votes
2 answers

Error in Eclipse-Tomcat Setup - ClassNotFoundException "1catalina.org.apache.juli.FileHandler"

Setup: Eclipse Juno R, Tomcat 7.0.8, tomcat run through eclipse plug in. Tomcat launch configuration from eclipse has VM argument -Djava.util.logging.config.file="C:\WS\Serverlogs\tomcat7\conf\logging.properties" (Ref: Where can I view Tomcat log…
vjkumar
  • 171
  • 1
  • 3
  • 10
13
votes
5 answers

RemoteException java.rmi.UnmarshalException: error unmarshalling return

I'm running the program here on 2 JVMs on diff physical machines. I get the error RemoteException java.rmi.UnmarshalException: error unmarshalling return; nested exception is: java.lang.ClassNotFoundException: CalculatorImpl_Stub (no…
P R
  • 1,293
  • 7
  • 28
  • 58
13
votes
6 answers

ClassNotFoundException with com.mysql.cj.jdbc.Driver, MySQL Connector and IntelliJ IDEA

I'm building up a Maven Java 1.8 project in which I've included the MySQL Connector as a dependency: mysql mysql-connector-java 5.1.39
13
votes
1 answer

Ant: Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/tools/ant/launch/Launcher

I've installed ubuntu 10.10 in my system and installed ant with the following command: sudo apt-get install ant Now, ant is visible in the share folder, so I've tried to run the ant command in terminal, but it gives me this error: Exception in…
Swathi EP
  • 3,864
  • 6
  • 26
  • 25
13
votes
1 answer

Link of class 'Landroid/support/v4/app/Watson; failed - Unable to resolve superclass of Lcom/actionbarsherlock/app/SherlockActivity

I have an android project that I was working on a few weeks ago it was working fine in my last attempt, but now the project all compiles fine, but while launching application, I am getting the following warning and it crashes my application. Unable…
bCliks
  • 2,918
  • 7
  • 29
  • 52
13
votes
1 answer

jetty:run causes class not found exception for org.mortbay.jetty.webapp.WebAppContext

Hi i have the following configuration. org.mortbay.jetty jetty-maven-plugin 8.1.3.v20120416 and in my jetty-env.xml I have
Chun ping Wang
  • 3,879
  • 12
  • 42
  • 53