java – NoClassDefFoundError:org / apache / hadoop / conf / Configuration

我正在尝试安装oozie并收到此错误.我有hadoop 2.7.1,maven 3.3.3.对此有何建议?

huseyin@ubuntu:~$
‘/usr/local/oozie/oozie/Oozie/oozie-4.3.0-SNAPSHOT/bin/oozie-setup.sh’
sharelib create -fs hdfs://hadoopcluster:10000 setting
CATALINA_OPTS=”$CATALINA_OPTS -Xmx1024m”

Error: A JNI error has occurred, please check your installation and
try again Exception in thread “main” java.lang.NoClassDefFoundError:
org/apache/hadoop/conf/Configuration at
java.lang.Class.getDeclaredMethods0(Native Method) at
java.lang.Class.privateGetDeclaredMethods(Class.java:2701) at
java.lang.Class.privateGetMethodRecursive(Class.java:3048) at
java.lang.Class.getMethod0(Class.java:3018) at
java.lang.Class.getMethod(Class.java:1784) at
sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
at
sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
Caused by: java.lang.ClassNotFoundException:
org.apache.hadoop.conf.Configuration 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) … 7 more

最佳答案 您需要将oozie所需的所有罐子添加到工作目录(oozie-4.3.0-SNAPSHOT)中名为libext的新文件夹中,请查看以下段落中的
oozie docs

By default, oozie war will not contain hadoop and hcatalog libraries,
however they are required for oozie to work.

There are 2 options to add these libraries:

  1. At install time, copy the hadoop and hcatalog libraries to libext and run oozie-setup.sh to setup oozie war.

  2. Build with -Puber which will bundle the required libraries in the oozie war.

所以要解决你需要的问题:

1-在扩展Oozie的目录中创建一个libext /目录.

2-如果使用ExtJS库将ZIP文件复制到libext /目录.

3-如果战争中尚未包含hadoop和hcatalog库,请将相应的库添加到libext /目录中. (在您的情况下),您可以将hadoop项目项目中的所有jar复制到libext文件夹.

重要说明:libext文件夹中的jar版本应与构建过程中安装的版本相匹配.

您可以在构建过程中使用的pom文件中找到下载的版本.

点赞