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

Standalone clojure app

I'm a beginner with clojure, only starting it yesterday. I have gathered that a simple way to create a standalone app is with leiningen lein new foo. I tried to create a hello world test project with leiningen. I added :main and :aot directives to…
Masse
  • 4,334
  • 3
  • 30
  • 41
18
votes
4 answers

JSONObject ClassNotFoundException

I am working in IntelliJ and using Maven. I have a class that uses JSONObject: import org.json.JSONObject; try { JSONObject documentObj = new JSONObject(document); } catch (Exception e) { throw new RuntimeException("Failed to convert JSON…
kimmii12
  • 183
  • 1
  • 1
  • 4
17
votes
6 answers

ClassNotFoundException when running JUnit unit tests within Eclipse (using Maven)

I have just upgraded my SpringSource Tools Suite (STS, a variant IDE of Eclipse) to the latest version (v3.6.1). Then all my JUnit unit tests can not be run again. I am getting this error: Class not found…
newguy
  • 5,668
  • 12
  • 55
  • 95
17
votes
1 answer

Getting noclassfoundexception : java.sql.SQLException in intellij idea for jdk 11

I am using latest version of Intellij Idea and set jdk as 11. When I execute my project it throws exception noclassfoundexception : java.sql.SQLException. In java compiler settings in Intellij I have mentioned project bytecode version as 11. In…
user3592376
  • 221
  • 1
  • 3
  • 8
17
votes
2 answers

java.lang.ClassNotFoundException : dalvik.system.BaseDexClassLoader.findClass

I'm continuously getting this error report in my Google Play developer console. It look like MultiDex error. java.lang.RuntimeException: at android.app.LoadedApk.makeApplication(LoadedApk.java:516) at…
17
votes
4 answers

Android : app loading library at runtime on Lollipop but not IceCreamSandwich

I'm currently developping an Android app using Android Studio. Currently, the app is launching perfectly on Lollipop devices, but crashes at launch due to a ClassNotFoundException on pre-lollipop devices (i've tested on ICS and it fail). The missing…
17
votes
4 answers

java.lang.ClassCastException: com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnectionOldImpl cannot be cast to javax.net.ssl.HttpsURLConnection

I tried this code in my Netbeans 7.4 and it works without problem import java.io.IOException; import java.net.URL; import javax.net.ssl.HttpsURLConnection; public class JavaApplication148 { public static void main(String[] args) throws…
libik
  • 22,239
  • 9
  • 44
  • 87
17
votes
2 answers

Android ClassNotFoundException with ViewPager

I am getting the following error, which I don't understand... 06-15 22:06:49.196: W/dalvikvm(17622): threadid=1: thread exiting with uncaught exception (group=0x40bcc1f8) 06-15 22:07:05.031: W/dalvikvm(17877): threadid=1: thread exiting with…
16
votes
6 answers

AWS Lambda: class java.lang.ClassNotFoundException

I am getting this message and I have no idea how to resolve it. Searched online and tried to implement their suggestion, but no luck yet. I basically followed the instructions specified in this link…
Rito
  • 3,092
  • 2
  • 27
  • 40
16
votes
4 answers

Why can't load inner class? ClassNotFoundException

Why does the following code cause ClassNotFoundException? public class App02 { public static class A { } public static void main(String[] args) throws ClassNotFoundException { try { …
Suzan Cioc
  • 29,281
  • 63
  • 213
  • 385
15
votes
4 answers

How do I set the classpath that rmiregistry uses?

I'm trying to make a Java RMI client/server app. I'm running into problems starting up the server side of my app, as it keeps running into a ClassNotFoundException during the call to the Registry.bind() method when I attempt to start up the server…
Adrian
  • 191
  • 1
  • 1
  • 8
15
votes
5 answers

Debug in Eclipse - ClassNotFoundException

when i debug in Eclipse a simple console application, I get a lot of ClassNotFoundException lines in the debug Window. It is not an error, somewhat lower in another pane I get "Source not found.". I understand that it is because the source code of…
lmsasu
  • 7,459
  • 18
  • 79
  • 113
15
votes
2 answers

java.lang.ClassNotFoundException: javax.jms.JMSContext on tomcat 7

I have a spring web application which I am trying to deploy on tomcat 7. I got following error on tomcat 7 start-up: Caused by: java.lang.ClassNotFoundException: javax.jms.JMSContext This is because tomcat could not find javaee-api-7.0.jar which…
Saurabh
  • 151
  • 1
  • 1
  • 4
15
votes
3 answers

Why do I get java.lang.NoClassDefFoundError when I trying to run this code?

I want to map over the characters in a string, but I'm getting runtime errors. Example: object Hello { def hello(c: Char) { print(c) } def main(args: Array[String]) { "Hello World!".map(hello) } } Trace: scalac…
mcandre
  • 22,868
  • 20
  • 88
  • 147
14
votes
5 answers

java.sql.Time exception

does anybody met something like that? After switching to JAVA 9 I faced such problem Caused by: java.lang.NoClassDefFoundError: java/sql/Time at com.google.gson.Gson.(Gson.java:240) at…
Shell Scott
  • 1,679
  • 18
  • 28