Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/configuration/Configuration at org.apache.hadoop.metrics2.lib.DefaultMetricsSystem.<init>(DefaultMetricsSystem.java:38) at org.apache.hadoop.metrics2.lib.DefaultMetricsSystem.<clinit>(DefaultMetricsSystem.java:36) at org.apache.hadoop.security.UserGroupInformation$UgiMetrics.create(UserGroupInformation.java:120) at org.apache.hadoop.security.UserGroupInformation.<clinit>(UserGroupInformation.java:236) at org.apache.spark.util.Utils$.$anonfun$getCurrentUserName$1(Utils.scala:2539) at scala.Option.getOrElse(Option.scala:189) at org.apache.spark.util.Utils$.getCurrentUserName(Utils.scala:2539) at org.apache.spark.SparkContext.<init>(SparkContext.scala:314) at org.apache.spark.api.java.JavaSparkContext.<init>(JavaSparkContext.scala:58) at FileTest.main(FileTest.java:10) Caused by: java.lang.ClassNotFoundException: org.apache.commons.configuration.Configuration at java.net.URLClassLoader.findClass(URLClassLoader.java:387) at java.lang.ClassLoader.loadClass(ClassLoader.java:418) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355) at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
时间: 2023-08-06 17:03:59 浏览: 279
Exception in thread “main” java.lang.NoClassDefFoundError: org/apache/spark/SparkConf
这是一个 Java 报错信息,其中包含了两个错误信息:NoClassDefFoundError 和 ClassNotFoundException。这通常是由于缺少依赖库或类路径错误所导致的。在这个具体的错误中,缺少了 org.apache.commons.configuration.Configuration 类,可能是因为类路径错误或者缺少相应的依赖库。你需要检查你的类路径和依赖库是否正确配置。
阅读全文