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.

  • ClassNotFoundException and NoClassDefException
    via by Unknown author,
  • no class found exception
    via GitHub by mohsin111
    ,
  • Looks like that xUnit plugin v1.29 doesn't work correctly when working on slave. I get the error (see below). Looks like he tries to access a file "C:\Jenkins\userContent\xunit/BoostTest/1.x" which doesn't exist. Version 1.27 of plugin works correctly. [xUnit] [ERROR] - Conversion error remote file operation failed: C:\Jenkins\userContent\xunit/BoostTest/1.x at hudson.remoting.Channel@1ac04e8:channel ERROR: Publisher com.thalesgroup.hudson.plugins.xunit.XUnitPublisher aborted due to exception hudson.util.IOException2: remote file operation failed: C:\Jenkins\workspace\Anton-test at hudson.remoting.Channel@1510a2d:telco-builder at hudson.FilePath.act(FilePath.java:781) at hudson.FilePath.act(FilePath.java:767) at com.thalesgroup.hudson.plugins.xunit.XUnitPublisher.performTests(XUnitPublisher.java:164) at com.thalesgroup.hudson.plugins.xunit.XUnitPublisher.performXUnit(XUnitPublisher.java:112) at com.thalesgroup.hudson.plugins.xunit.XUnitPublisher.perform(XUnitPublisher.java:89) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19) at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:694) at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:669) at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:647) at hudson.model.Build$RunnerImpl.post2(Build.java:162) at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:616) at hudson.model.Run.run(Run.java:1429) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:230) Caused by: hudson.util.IOException2: There are some problems during the conversion into JUnit reports: at com.thalesgroup.hudson.plugins.xunit.service.XUnitTransformer.invoke(XUnitTransformer.java:164) at com.thalesgroup.hudson.plugins.xunit.service.XUnitTransformer.invoke(XUnitTransformer.java:37) at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2022) at hudson.remoting.UserRequest.perform(UserRequest.java:118) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:287) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: com.thalesgroup.hudson.plugins.xunit.exception.XUnitException: Conversion error remote file operation failed: C:\Jenkins\userContent\xunit/BoostTest/1.x at hudson.remoting.Channel@1ac04e8:channel at com.thalesgroup.hudson.plugins.xunit.service.XUnitConversionService.convert(XUnitConversionService.java:93) at com.thalesgroup.hudson.plugins.xunit.service.XUnitTransformer.invoke(XUnitTransformer.java:135) ... 11 more Caused by: hudson.util.IOException2: remote file operation failed: C:\Jenkins\userContent\xunit/BoostTest/1.x at hudson.remoting.Channel@1ac04e8:channel at hudson.FilePath.act(FilePath.java:781) at hudson.FilePath.act(FilePath.java:767) at hudson.FilePath.exists(FilePath.java:1035) at com.thalesgroup.hudson.plugins.xunit.service.XUnitConversionService.convertInputMetricXSL(XUnitConversionService.java:112) at com.thalesgroup.hudson.plugins.xunit.service.XUnitConversionService.convert(XUnitConversionService.java:82) ... 12 more Caused by: java.io.IOException: Remote call on channel failed at hudson.remoting.Channel.call(Channel.java:690) at hudson.FilePath.act(FilePath.java:774) ... 16 more Caused by: java.lang.NoClassDefFoundError: hudson/remoting/RemoteClassLoader$RemoteIClassLoader at hudson.remoting.RemoteClassLoader.export(RemoteClassLoader.java:353) at hudson.remoting.UserRequest.<init>(UserRequest.java:69) at hudson.remoting.Channel.call(Channel.java:680) ... 17 more Caused by: java.lang.ClassNotFoundException: hudson.remoting.RemoteClassLoader$RemoteIClassLoader 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 sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) ... 20 more Finished: FAILURE
    via by Anton Nikitin,
  • Looks like that xUnit plugin v1.29 doesn't work correctly when working on slave. I get the error (see below). Looks like he tries to access a file "C:\Jenkins\userContent\xunit/BoostTest/1.x" which doesn't exist. Version 1.27 of plugin works correctly. [xUnit] [ERROR] - Conversion error remote file operation failed: C:\Jenkins\userContent\xunit/BoostTest/1.x at hudson.remoting.Channel@1ac04e8:channel ERROR: Publisher com.thalesgroup.hudson.plugins.xunit.XUnitPublisher aborted due to exception hudson.util.IOException2: remote file operation failed: C:\Jenkins\workspace\Anton-test at hudson.remoting.Channel@1510a2d:telco-builder at hudson.FilePath.act(FilePath.java:781) at hudson.FilePath.act(FilePath.java:767) at com.thalesgroup.hudson.plugins.xunit.XUnitPublisher.performTests(XUnitPublisher.java:164) at com.thalesgroup.hudson.plugins.xunit.XUnitPublisher.performXUnit(XUnitPublisher.java:112) at com.thalesgroup.hudson.plugins.xunit.XUnitPublisher.perform(XUnitPublisher.java:89) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19) at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:694) at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:669) at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:647) at hudson.model.Build$RunnerImpl.post2(Build.java:162) at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:616) at hudson.model.Run.run(Run.java:1429) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:230) Caused by: hudson.util.IOException2: There are some problems during the conversion into JUnit reports: at com.thalesgroup.hudson.plugins.xunit.service.XUnitTransformer.invoke(XUnitTransformer.java:164) at com.thalesgroup.hudson.plugins.xunit.service.XUnitTransformer.invoke(XUnitTransformer.java:37) at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2022) at hudson.remoting.UserRequest.perform(UserRequest.java:118) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:287) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: com.thalesgroup.hudson.plugins.xunit.exception.XUnitException: Conversion error remote file operation failed: C:\Jenkins\userContent\xunit/BoostTest/1.x at hudson.remoting.Channel@1ac04e8:channel at com.thalesgroup.hudson.plugins.xunit.service.XUnitConversionService.convert(XUnitConversionService.java:93) at com.thalesgroup.hudson.plugins.xunit.service.XUnitTransformer.invoke(XUnitTransformer.java:135) ... 11 more Caused by: hudson.util.IOException2: remote file operation failed: C:\Jenkins\userContent\xunit/BoostTest/1.x at hudson.remoting.Channel@1ac04e8:channel at hudson.FilePath.act(FilePath.java:781) at hudson.FilePath.act(FilePath.java:767) at hudson.FilePath.exists(FilePath.java:1035) at com.thalesgroup.hudson.plugins.xunit.service.XUnitConversionService.convertInputMetricXSL(XUnitConversionService.java:112) at com.thalesgroup.hudson.plugins.xunit.service.XUnitConversionService.convert(XUnitConversionService.java:82) ... 12 more Caused by: java.io.IOException: Remote call on channel failed at hudson.remoting.Channel.call(Channel.java:690) at hudson.FilePath.act(FilePath.java:774) ... 16 more Caused by: java.lang.NoClassDefFoundError: hudson/remoting/RemoteClassLoader$RemoteIClassLoader at hudson.remoting.RemoteClassLoader.export(RemoteClassLoader.java:353) at hudson.remoting.UserRequest.<init>(UserRequest.java:69) at hudson.remoting.Channel.call(Channel.java:680) ... 17 more Caused by: java.lang.ClassNotFoundException: hudson.remoting.RemoteClassLoader$RemoteIClassLoader 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 sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) ... 20 more Finished: FAILURE
    via by Anton Nikitin,
    • java.lang.NoClassDefFoundError: scopt/OptionParser at scalaxb.compiler.Main$.start(Main.scala:50) at scalaxb.compiler.SbtApp.run(SbtApp.scala:8) at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:109) at xsbt.boot.Launch$.withContextLoader(Launch.scala:128) at xsbt.boot.Launch$.run(Launch.scala:109) at xsbt.boot.Launch$$anonfun$apply$1.apply(Launch.scala:35) at xsbt.boot.Launch$.launch(Launch.scala:117) at xsbt.boot.Launch$.apply(Launch.scala:18) at xsbt.boot.Boot$.runImpl(Boot.scala:41) at xsbt.boot.Boot$.main(Boot.scala:17) at xsbt.boot.Boot.main(Boot.scala) Caused by: java.lang.ClassNotFoundException: scopt.OptionParser at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 11 more

    Users with the same issue

    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown UserUnknown User
    1 times, last one,
    Andreas HäberAndreas Häber
    1 times, last one,
    rprp
    1 times, last one,
    2331 more bugmates