javaNoClassDefFoundError: org/apache/hadoop/conf/配置
我正在尝试安装 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 所需的所有 jar 添加到工作目录 (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:
At install time, copy the hadoop and hcatalog libraries to libext and run oozie-setup.sh to setup oozie war.
Build with -Puber which will bundle the required libraries in the oozie war.
所以要解决你需要的问题:
1- 在 Oozie 展开的目录中创建一个 libext/目录。
2- 如果使用 ExtJS 库,请将 ZIP 文件复制到 libext/目录。
3- 如果 hadoop 和 hcatalog 库尚未包含在 war 中,请将相应的库添加到 libext/目录。 (在你的情况下),你可以将所有的 jar 从你的 hadoop 项目复制到 libext 文件夹。
重要说明:libext 文件夹中的 jar 版本应与构建过程中安装的版本相匹配。
您可以在构建过程中使用的 pom 文件中找到下载的版本。
1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,请转载时务必注明文章作者和来源,不尊重原创的行为我们将追究责任;3.作者投稿可能会经我们编辑修改或补充。