java.lang.ClassNotFoundException

If you like a tip written by other Samebug users, mark is as helpful! Marks help our algorithm provide you better solutions and also help other users.
tip

This might be an issue with the file location in the Spark submit command. Try it with "spark-submit --master spark://master:7077 hello_world_from_pyspark.py {file location}"

tip

Check if you've set a name in Application -> Run. If you didn't, the generated XML is gonna have missing information and then this exception will be thrown.

tip

You might've forgot to add a dependency or it's written wrong. Also, you might be using incompatible versions of Java and Hibernate. More on this here: https://goo.gl/SjSlRA

tip

If you're using Hibernate, this indicates you're missing FasterXML Classmate dependency, which you can add to your dependencies. To add it, the groupId is com.fasterxml and artifactId is Classmate.

tip

Check if you didn't forget to instantiate your topic in the kafka broker.

tip

NoClassDefFoundError means java has failed to find a class you're trying to instantiate, look if you've added the class you're trying to instantiate to the dependencies.

tip

This error means there's a class missing in your classpath during runtime. You need to create a jar with all your dependencies and have it in your classpath. Check Maven Assembly Plugin and how to add your dependencies to a jar: https://goo.gl/U2zr8k

tip

jsp-api and servlet-api jars must NOT be deployed by your web app. They should be marked as provided but not deployed by your app.

tip

You need to add httpcore to your dependencies. Try adding version 4.3 or further.

tip

The server rejects all jars that already belong to the server runtime (such as tomcat-**.jar, servlet**.jar). Consider substituting the CORS filter you're using for this one: https://goo.gl/ctQ7Fs

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • Running example 13 as it is fails with Could not load driverClass org.postgresql.Driver java.lang.ClassNotFoundException: org.postgresql.Driver at java.net.URLClassLoader$1.run(URLClassLoader.java:366) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:423) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:356) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:186) at com.mchange.v2.c3p0.DriverManagerDataSource.ensureDriverLoaded(DriverManagerDataSource.java:101) at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:133) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137) at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014) at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32) at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810) at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547) [WARN] 16 Sep 01:21:10.763 PM com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0 [com.mchange.v2.c3p0.DriverManagerDataSource] Could not load driverClass org.postgresql.Driver which is not surprising because the intended classpath to find postgres.jar rem Put the path to your JDBC driver(s) in this variable @SET JDBC_CP=..\..\lib\postgres.jar "java" -cp "%QUARTZ_CP%;%JDBC_CP%" %QUARTZ_PROPS% %LOG4J_PROPS% org.quartz.examples.example13.ClusterExample %1 will not find it at Directory of C:\Terracotta\terracotta-ee-3.5.3-nightly-rev18716\quartz\lib 09/15/2011 11:34 AM <DIR> . 09/15/2011 11:34 AM <DIR> .. 01/18/2011 12:17 AM 608,376 c3p0-0.9.1.1.jar 04/21/2009 08:05 AM 15,071 jta-1.1.jar 01/09/2009 01:12 PM 367,444 log4j-1.2.14.jar 12/17/2010 12:32 PM 25,496 slf4j-api-1.6.1.jar 01/18/2011 12:17 AM 9,753 slf4j-log4j12-1.6.1.jar ============================================================================================ Now, it is unclear whether the example is telling the user to go get their own database and put their own jar there; if so it should be a lot more explicit than is currently the case at https://svn.terracotta.org/repo/quartz/trunk/examples/example13/clustering_readme.txt Furthermore the readme states that scripts to setup the database tables for various popular databases are included with quartz; however 1) It does not say where 2) I cannot find them So it seems like there's at least one issue of documentation for how/where to get the DB set up, and potentially one for us not including the needed jars/scripts to actually get things working.
    via by Yi Zhang,
  • Running example 13 as it is fails with Could not load driverClass org.postgresql.Driver java.lang.ClassNotFoundException: org.postgresql.Driver at java.net.URLClassLoader$1.run(URLClassLoader.java:366) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:423) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:356) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:186) at com.mchange.v2.c3p0.DriverManagerDataSource.ensureDriverLoaded(DriverManagerDataSource.java:101) at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:133) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137) at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014) at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32) at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810) at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547) [WARN] 16 Sep 01:21:10.763 PM com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0 [com.mchange.v2.c3p0.DriverManagerDataSource] Could not load driverClass org.postgresql.Driver which is not surprising because the intended classpath to find postgres.jar rem Put the path to your JDBC driver(s) in this variable @SET JDBC_CP=..\..\lib\postgres.jar "java" -cp "%QUARTZ_CP%;%JDBC_CP%" %QUARTZ_PROPS% %LOG4J_PROPS% org.quartz.examples.example13.ClusterExample %1 will not find it at Directory of C:\Terracotta\terracotta-ee-3.5.3-nightly-rev18716\quartz\lib 09/15/2011 11:34 AM <DIR> . 09/15/2011 11:34 AM <DIR> .. 01/18/2011 12:17 AM 608,376 c3p0-0.9.1.1.jar 04/21/2009 08:05 AM 15,071 jta-1.1.jar 01/09/2009 01:12 PM 367,444 log4j-1.2.14.jar 12/17/2010 12:32 PM 25,496 slf4j-api-1.6.1.jar 01/18/2011 12:17 AM 9,753 slf4j-log4j12-1.6.1.jar ============================================================================================ Now, it is unclear whether the example is telling the user to go get their own database and put their own jar there; if so it should be a lot more explicit than is currently the case at https://svn.terracotta.org/repo/quartz/trunk/examples/example13/clustering_readme.txt Furthermore the readme states that scripts to setup the database tables for various popular databases are included with quartz; however 1) It does not say where 2) I cannot find them So it seems like there's at least one issue of documentation for how/where to get the DB set up, and potentially one for us not including the needed jars/scripts to actually get things working.
    via by Yi Zhang,
  • GitHub comment 1359#132109887
    via GitHub by ilevans
    ,
  • Error create server
    via GitHub by douglaspedro
    ,
  • GitHub comment 1525#156225891
    via GitHub by sammy1000
    ,
  • JavaRoots: Driver Class Not Found Error In MULE
    via by Unknown author,
    • java.lang.ClassNotFoundException: org.postgresql.Driver at java.net.URLClassLoader$1.run(URLClassLoader.java:366) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:423) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:356) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:186) at com.mchange.v2.c3p0.DriverManagerDataSource.ensureDriverLoaded(DriverManagerDataSource.java:101) at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:133) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137) at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014) at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32) at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810) at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)[WARN]

    Users with the same issue

    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    zsamboki
    1 times, last one,
    Pilleo
    2 times, last one,
    kimihanif
    1 times, last one,
    1376 more bugmates