java.lang.NoClassDefFoundError

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

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.

  • When using AntActionInstallerListener, there is the need to add commons-io.jar to the list of jars in install.xml, otherwise the installer will fail with: {code} FEIN: Executing all beforepack Ant actions of pack mycore ... Exception in thread "IzPack - Unpacker thread" java.lang.NoClassDefFoundError: org/apache/commons/io/FileUtils at com.izforge.izpack.event.AntAction.createLogger(AntAction.java:519) at com.izforge.izpack.event.AntAction.performAction(AntAction.java:162) at com.izforge.izpack.event.AntAction.performInstallAction(AntAction.java:118) at com.izforge.izpack.event.AntActionInstallerListener.performAllActions(AntActionInstallerListener.java:310) at com.izforge.izpack.event.AntActionInstallerListener.beforePack(AntActionInstallerListener.java:200) at com.izforge.izpack.installer.event.InstallerListeners.beforePack(InstallerListeners.java:190) at com.izforge.izpack.installer.unpacker.UnpackerBase.unpack(UnpackerBase.java:429) at com.izforge.izpack.installer.unpacker.UnpackerBase.unpack(UnpackerBase.java:251) at com.izforge.izpack.installer.unpacker.UnpackerBase.run(UnpackerBase.java:236) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.ClassNotFoundException: org.apache.commons.io.FileUtils at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 10 more {code} Normally, , there should be all classes built-in needed by the Ant action execution functionality except dependencies that Ant and native or additional Ant tasks need. Add Apaches's FileUtils and depending classes as built-in classes to the installer.
    via by René Krell [Administrator],
  • Guvnor rules encoding
    via Stack Overflow by ZeKoU
    ,
  • Tomcat 7 / Java 8 ClassNotFoundException
    via Stack Overflow by nfeuerhelm
    ,
    • java.lang.NoClassDefFoundError: org/apache/commons/io/IOUtils at com.sample.exercise.Main.getFileWithUtil(Main.java:21) at com.sample.exercise.Main.main(Main.java:13) Caused by: java.lang.ClassNotFoundException: org.apache.commons.io.IOUtils 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) ... 2 more

    Users with the same issue

    Unknown visitor
    Unknown visitor3 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    MattyMatty
    1 times, last one,
    oddodd
    1 times, last one,
    2331 more bugmates