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
24
votes
12 answers

ClassNotFoundException when starting tomcat

I'm trying to make a REST web service. My project looks like : The traceback is : 8 déc. 2011 18:31:36 org.apache.catalina.core.AprLifecycleListener init INFO: The Apache Tomcat Native library which allows optimal performance in production …
Seb P
  • 677
  • 3
  • 8
  • 19
24
votes
3 answers

IntelliJ IDEA: ClassNotFoundException if run Debug, execution/run does work

I have a Java Maven Project started in Eclipse, worked on it a few days, then imported it in IntelliJ IDEA, again working on it a few days. The normal Run/Execution in IDEA and via shell does work, but not the Debug. When I click the Bug Icon for…
24
votes
9 answers

java.lang.ClassNotFoundException: org.postgresql.Driver, Android

I am running Eclipse on Windows. Following this tutorial I downloaded JDBC4, added it to my build path using Project>Properties>add External JAR, browsed for the file, it worked (.classpath file shows the correct lib path). The package appears in…
user1438048
  • 241
  • 1
  • 2
  • 3
23
votes
2 answers

java.lang.ClassNotFoundException: com.google.wireless.android.sdk.stats.IntellijIndexingStats$Index

When I'm trying to Make Module in order to build my project I'm getting the java.lang.ClassNotFoundException: com.google.wireless.android.sdk.stats.IntellijIndexingStats$Index error I've tried what it says on this posts, but with no…
Alex Telehoi
  • 341
  • 2
  • 3
23
votes
6 answers

Tomcat throws ClassNotFound exceptions for classes in other open eclipse projects

I have an eclipse project structure that looks something like this: eclipse project a project b All of these projects are Maven projects. Project B is an Eclipse WTP project and contains Project A as a dependency. I'm using the m2eclipse…
Ben J
  • 5,811
  • 2
  • 28
  • 32
22
votes
10 answers

eclipse/tomcat: deploy doesn't work any more (ClassNotFoundException)

I'm running Eclipse Helios Service Release 1, with Tomcat 7.0.12 in Linux Ubuntu Natty Narwhal. I've been happily hot re-deploying my webapp until it stopped working for apparently no reason. The following exception is displayed: SEVERE: Allocate…
stivlo
  • 83,644
  • 31
  • 142
  • 199
22
votes
9 answers

java.lang.ClassNotFoundException in spite of using CLASSPATH environment variable

I am trying to connect to mysql database using java on windows7. In spite of adding the complete url of jdbcdriver jar file in CLASSPATH, java.lang.ClassNotFoundException: com.mysql.jdbc.Driver is thrown. Could anyone tell me what i am missing here?…
Nitin Garg
  • 2,069
  • 6
  • 25
  • 50
21
votes
13 answers

Android app ClassNotFoundException for main activity

Most of the devices can run my app but I got this error report : java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.company.app/com.company.app.MainActivity}: java.lang.ClassNotFoundException: com.company.app.MainActivity…
Kay Chan
  • 345
  • 1
  • 3
  • 11
21
votes
3 answers

ClassNotFoundException: org.springframework.jdbc.datasource.DriverManagerDataSource

I was trying to do some basic database operations. I'm using STS 3.2.0, Apache Tomcat 7. My dispatcher-servlet.xml includes:
JuniorDev
  • 1,170
  • 2
  • 9
  • 19
21
votes
7 answers

Android: class not found exception: android.support.v4.app.FragmentPager

In my code I import android.support.v4.view.ViewPager but I get a ClassNotFoundException: android.support.v4.view.ViewPager when I set content view to this xml file: ...
user1324936
  • 2,187
  • 4
  • 36
  • 49
20
votes
4 answers

ClassNotFoundException: Didn't find class "android.os.PersistableBundle" Otto Android 5.0

I have a strange issue. I have an app which I deployed on an Android 4.4 device and use Otto library. I deployed the app on an Android 5.0 device. It still works. I retried on the 4.4 and the app won't launched. Apparently, it tries to use…
Cocorico
  • 1,998
  • 1
  • 22
  • 38
20
votes
3 answers

ClassNotFoundException upon running JAR, no errors while running in IntelliJ IDEA

I'm just starting to build Java apps (I do have .NET experience) and I was trying to build a small test app whose whole code is this : package com.company; import com.microsoft.sqlserver.jdbc.SQLServerDataSource; import java.sql.Connection; import…
Andrei Rînea
  • 20,288
  • 17
  • 117
  • 166
20
votes
2 answers

What could cause a sudden ClassNotFoundException in a long running process?

We have a very small Web service (less than 1K lines of code) which is run by Jetty. The service worked always fine even during our stress testing phase. However, after 13 days of uptime we experienced a ClassNotFoundException in two nodes the same…
Sebastian
  • 1,835
  • 3
  • 22
  • 34
19
votes
6 answers

java.lang.ClassNotFoundException: org.apache.commons.lang.StringUtils from BaseClassLoader

I am getting the following error, while running my following code: java.lang.ClassNotFoundException: org.apache.commons.lang.StringUtils from BaseClassLoader at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:448) at…
Amit Kumar
  • 285
  • 1
  • 5
  • 13
19
votes
1 answer

java.lang.ClassNotFoundException : com.sun.faces.config.ConfigureListener

We are three people developing a JSF project and we've not been into JSF before. Oddly, with the same data checked out from SVN, one of the team members gets an 404 error everytime using Tomcat 7.0.27. At the time when Tomcat (used inside Eclipse)…
Wolfgang Gaar
  • 192
  • 1
  • 3
  • 8