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
6
votes
4 answers

ClassNotFoundException on subsequent builds after converting MainActivity to Kotlin

I want to give Kotlin a try, so I decided to try to convert a single class of my project to Kotlin and see how it integrates with my workflow before trying to convert my entire project. I am able to build and my app works properly, but on every…
Damien Diehl
  • 383
  • 4
  • 13
6
votes
6 answers

ClassNotFoundException Android

So I ran into a problem today while working on my Android program. I have a class that turns that an XML string into a Java object (third party) and it works fine in as a regular java project but on Android I get this weird error: 06-21…
jakehschwartz
  • 1,005
  • 2
  • 13
  • 32
6
votes
1 answer

ColdFusion/Java Class not found Exception

I am trying to parse a CSV File with Coldfusion and a JavaLibrary. I found some examples but it seems that ColdFusion cannot find the Jar-File. This is my Code: fileReader =…
noah
  • 174
  • 9
6
votes
1 answer

java.lang.NoClassDefFoundError: org/lwjgl/LWJGLException

Trying to work on a game for school and I keep getting a "java.lang.NoClassDefFoundError: org/lwjgl/LWJGLException" when trying to run using eclipse. Any ideas? Here is my code package javagame; import org.newdawn.slick.*; import…
6
votes
3 answers

Geofences (Android sample app) java.lang.ClassNotFoundException MainActivity

I have an ASUS Eee Tab (Transformer Prime TF201 Android v4.1.1). I was reading the API on Geofencing and downloaded the sample app here below on to my device => http://developer.android.com/training/location/geofencing.html. But it terminates when i…
6
votes
3 answers

Hazelcast Serializable Map ClassNotFound Exception

I am trying to implement Hazelcast in a simple web application. I am trying to store a custom object into my Hazelcast Map and have implemented Serializable in my Bid Object Class with the necessary imports. import java.io.Serializable; Here is a…
6
votes
4 answers

Unable to initialize FacesServlet in Tomcat 7 - ClassNotFoundException

I am trying out a simple hello world app in JSF but based on the exception thrown by tomcat on start I see that FacesServlet is not getting initialized. I have the required jar files myfaces-api, bundle, impl and commons beanutils, codec,…
DevZer0
  • 13,433
  • 7
  • 27
  • 51
6
votes
3 answers

classpath - running a java program from the command line

My code compiled fine with the following command: javac -cp "../lib/*" AvroReader.java (lib is where i put my jar files) At run time I get a ClassNotFoundException on the following line: DatumReader dtmrdr = new GenericDatumReader(); It says it…
Dao Lam
  • 2,837
  • 11
  • 38
  • 44
6
votes
4 answers

java "ClassNotFoundException" error

I am new to java programming and I am getting the much-maligned error "ClassNotFoundException" error. The strange thing is is that it compiles fine: java -cp /usr/share/java/scribe-1.3.0.jar FacebookProg But when I try to run it, I get the…
Steve Quezadas
  • 724
  • 2
  • 11
  • 27
5
votes
1 answer

ProviderSettings class not found it says Cannot resolve symbol ProviderSettings

I am new to spring boot space. I am following a tutorial learning to create OAuth authentication server. While configuring the AuthorizationServerConfig.java the instructor imports 'ProviderSettings' class from package…
5
votes
4 answers

Java: How to reproduce Legen...dary ClassNotFoundException in Singleton?

On my last interview I was asked a standard question about all Singleton implementations in java. And how bad they all are. And I was told that even the static initialization is bad because of the probability of unchecked exception in…
leshka
  • 1,764
  • 6
  • 32
  • 42
5
votes
1 answer

ClassNotFoundException in navigation graph android

I saw this crash over firebase and it is not reporducible in the emulator of same OS. Not sure what is causing it. Crash is occuring in samsung M32 OS 11. The crash is Caused by java.lang.RuntimeException: java.lang.ClassNotFoundException:…
5
votes
2 answers

"Could not find the main class"

I'm trying to run a sample Java application from the command promopt but I'm getting the following error: Exception in thread "main" java.lang.NoClassDefFoundError: com/badlogic/gdx/helloworld/HelloWorldDesktop Caused by:…
Justin
  • 84,773
  • 49
  • 224
  • 367
5
votes
2 answers

java.lang.ClassNotFoundException without the name of the class

I have a Unity game deployed to Android. In Google play console, I am seeing many crashes that happen on old Android versions (<=7.1). The crash is caused by a ClassNotFoundException, but the report does not show the class that is not found. In the…
5
votes
10 answers

java.lang.ClassNotFoundException throwing some error

java.lang.ClassNotFoundException: org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter I added following jar…
Hardik Bhalani
  • 863
  • 2
  • 8
  • 24