java.lang.NoClassDefFoundError

tip

A few things cause this exception: 1) Check if you have all jars and if they're in the correct path when running. 2) Your classpath might be broken, you can define it in the command line with "java -cp yourClassPath" or at your IDE if you're using one.

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

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

tip

Needs to add netty-transport-native-epoll with a OS classifier to the classpath, it's not included in netty-all

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}"

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

  • class loader on windows
    via by Tim Schaub,
  • admaDIC Blog
    via by Unknown author,
  • admaDIC Blog: JavaFX FXMLLoader with OSGi
    via by Unknown author,
  • Using Jenkins 1.509 Jenkins GIT client plugin 1.0.5 Jenkins GIT plugin 1.3.0 Gerrit Trigger 2.9.0 The following error is thrown: Retriggered by user anonymous for Gerrit: http://172.18.48.95/1 Building in workspace /home/ggargiulo/.jenkins/workspace/destination-management-gerrit Checkout:destination-management-gerrit / /home/ggargiulo/.jenkins/workspace/destination-management-gerrit - hudson.remoting.LocalChannel@2a081f8f Using strategy: Gerrit-Plugin Fetching changes from 1 remote Git repository Fetching upstream changes from origin FATAL: org/spearce/jgit/lib/ObjectId java.lang.NoClassDefFoundError: org/spearce/jgit/lib/ObjectId at hudson.plugins.gerrit.buildchoosers.GerritBuildChooser.parseCommit(GerritBuildChooser.java:111) at hudson.plugins.gerrit.buildchoosers.GerritBuildChooser.sortRevList(GerritBuildChooser.java:90) at hudson.plugins.gerrit.buildchoosers.GerritBuildChooser.getCandidateRevisions(GerritBuildChooser.java:46) at hudson.plugins.git.util.BuildChooser.getCandidateRevisions(BuildChooser.java:81) at hudson.plugins.git.util.BuildChooser.getCandidateRevisions(BuildChooser.java:71) at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1044) at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:942) at hudson.FilePath.act(FilePath.java:865) at hudson.FilePath.act(FilePath.java:838) at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:942) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1101) at hudson.model.AbstractProject.checkout(AbstractProject.java:1364) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:670) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:575) at hudson.model.Run.execute(Run.java:1575) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:237) Caused by: java.lang.ClassNotFoundException: org.spearce.jgit.lib.ObjectId at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) ... 19 more
    via by Giovanni Gargiulo,
  • Using Jenkins 1.509 Jenkins GIT client plugin 1.0.5 Jenkins GIT plugin 1.3.0 Gerrit Trigger 2.9.0 The following error is thrown: Retriggered by user anonymous for Gerrit: http://172.18.48.95/1 Building in workspace /home/ggargiulo/.jenkins/workspace/destination-management-gerrit Checkout:destination-management-gerrit / /home/ggargiulo/.jenkins/workspace/destination-management-gerrit - hudson.remoting.LocalChannel@2a081f8f Using strategy: Gerrit-Plugin Fetching changes from 1 remote Git repository Fetching upstream changes from origin FATAL: org/spearce/jgit/lib/ObjectId java.lang.NoClassDefFoundError: org/spearce/jgit/lib/ObjectId at hudson.plugins.gerrit.buildchoosers.GerritBuildChooser.parseCommit(GerritBuildChooser.java:111) at hudson.plugins.gerrit.buildchoosers.GerritBuildChooser.sortRevList(GerritBuildChooser.java:90) at hudson.plugins.gerrit.buildchoosers.GerritBuildChooser.getCandidateRevisions(GerritBuildChooser.java:46) at hudson.plugins.git.util.BuildChooser.getCandidateRevisions(BuildChooser.java:81) at hudson.plugins.git.util.BuildChooser.getCandidateRevisions(BuildChooser.java:71) at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1044) at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:942) at hudson.FilePath.act(FilePath.java:865) at hudson.FilePath.act(FilePath.java:838) at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:942) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1101) at hudson.model.AbstractProject.checkout(AbstractProject.java:1364) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:670) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:575) at hudson.model.Run.execute(Run.java:1575) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:237) Caused by: java.lang.ClassNotFoundException: org.spearce.jgit.lib.ObjectId at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) ... 19 more
    via by Giovanni Gargiulo,
    • java.lang.NoClassDefFoundError: com/thoughtworks/xstream/converters/ConversionException at com.staples.mobilautomation.JMeterFromExistingJMX.main(JMeterFromExistingJMX.java:22) Caused by: java.lang.ClassNotFoundException: com.thoughtworks.xstream.converters.ConversionException at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 1 more

    Users with the same issue

    Unknown visitor1 times, last one,
    odd
    1 times, last one,
    tvrmsmith
    2 times, last one,
    junior_cEngineer
    1 times, last one,
    Matty
    1 times, last one,
    2331 more bugmates