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
0
votes
0 answers

ClassNotFoundException in a default Maven Java project

Since I have instlalled Netbeans 10 IDE, I cant't run my project outside this IDE. With Netbeans opened, everything is ok and no "ClassNotFoundException" message is displayed. Therefore, if I run the project outside IDE, a "ClassNotFoundException"…
BicaBicudo
  • 307
  • 1
  • 8
  • 20
0
votes
1 answer

ClassNotFoundException when connecting to an Azure databse

I am trying to connect a Java application to an Azure database stored in the cloud. I keep receiving the ClassNotFoundException when running Class.forName("org.mariadb.jdbc"); I am experienced with Java, but new to connecting a Java application to…
M. Rogers
  • 367
  • 4
  • 18
0
votes
1 answer

NoClassDefFoundError while reading Excel sheet data and printing values

NoClassDefFoundError while reading Excel sheet data and printing values I am getting classnotfound exception for below code : package practice; import java.io.FileInputStream; import java.io.FileNotFoundException; import…
Anju
  • 1
  • 1
0
votes
1 answer

java.lang.ClassNotFoundException: org.apache.james.mime4j.message.Message

I have a JBoss application on google cloud VM which has an API to upload a zip files. I am getting below error while making call to API. Note this happens only with JBoss on google Cloud but not with non-cloud application…
Amit
  • 36
  • 7
0
votes
1 answer

Error "java.lang.ClassNotFoundException" stopping me from running the app

Good day, I have a small issue, that despite finding a couple of solutions online, I wasn't able to apply the proper outcome to my project. This is my code: package RandomKeyGenerator; import java.util.Random; import java.util.Scanner; public…
Neelfinity
  • 59
  • 9
0
votes
0 answers

How to define database 'driver' using Groovy sql module

I am trying to connect to an Oracle Sql Developer DB using Groovys sql class, which requires 4 pieces of information: (db url, username, password, db driver) I have all information needed except the driver. I have tried using…
0
votes
1 answer

Cannot load play.http.errorHandler - custom handler not invoked

I am attempting to load a custom error handler in Play Framework (2.6) as per the documentation but am receiving the following error message - Cannot load play.http.errorHandler Custom error handler (app/services/ErrorHandler) package…
0
votes
1 answer

Error in Java application (using Eclipse): "java.lang.ClassNotFoundException: org.hsqldb.jdbc.JDBCDriver"

I'm using Eclipse to write a Java program that is trying to connect to HSQLDB. When I try to run the program I get this error: java.lang.ClassNotFoundException: org.hsqldb.jdbc.JDBCDriver How do I fix it?
Callum
  • 435
  • 1
  • 4
  • 14
0
votes
0 answers

java.lang.ClassNotFoundException When Filepath is Correct

I'm working with Spring right now and have been trying to resolve a number of Failed to load ApplicationContext errors. This latest one is because it can't find a specific class when creating a bean structured like the following:
0
votes
0 answers

Unable to load/reference corresponding dll and jars in java

I have several SDK's which, when installed on Windows, create a folder in C://Program Files//SDK Name//folders and files. I have a switch case in main method of the setup class where, based on the string input which provides SDK name, I need to…
0
votes
0 answers

Why does ClassNotFoundException not caught?

My java application throws ClassNotFoundException, but this exception should be caught in this line java.lang.ClassLoader.loadClass(ClassLoader.java:411). Due to some reason I can only post part of stack here and I added a java agent to my…
ganle hu
  • 97
  • 8
0
votes
2 answers

Android / Sending activity context through intent

I have 5 or so activities in Android (2 of them have been shown below), which share a common Navigation Drawer. If I log in into some account from the Navigation Drawer, after successful log in, the activity which was previously showing needs to be…
0
votes
1 answer

Flink 1.9 SQL Client throws ClassNotFoundException: org.apache.kafka.clients.consumer.ConsumerRecord

Trying to use Flink 1.9 SQL-Client with Kafka without success. After figuring out about the required jar files and copying them into the lib directory, I am getting the following run-time exception when doing SELECT * FROM table-name: Flink SQL>…
Behzad Pirvali
  • 764
  • 3
  • 10
  • 28
0
votes
0 answers

Put classes files in WEB-INF

I have directory with classes files. I want to put them in the WEB-INF/classes directory, I don't have the source Java files, just the classes. When I start tomcat I got error java.lang.ClassNotFoundException because there is listener in the web.xml…
kfir
  • 732
  • 10
  • 22
0
votes
1 answer

Introducing a middle base class causes ActiveMQ/JMS NoClassDefFoundError

Currently I have an application that sends a JMS ObjectMessage to an ActiveMQ destination. The messages are all derived from class base. However, I needed to add a class between certain derived classes and the base class, so class middle extends…