简体   繁体   English

Cloudera VM上的Apache Giraph-ClassNotFoundException

[英]Apache Giraph on Cloudera VM - ClassNotFoundException

I am new to Hadoop/Giraph and Java. 我是Hadoop / Giraph和Java的新手。 As part of a task, I downloaded Cloudera Quickstart VM and Giraph on top of it. 作为任务的一部分,我在其之上下载了Cloudera Quickstart VM和Giraph。 I am using this book named "Practical Graph Analytics with Apache Giraph; Authors: Shaposhnik, Roman, Martella, Claudio, Logothetis, Dionysios" from which I tried to run the first example on Page 111 (Twitter Followership Graph). 我使用的书名为“使用Apache Giraph进行实践图分析;作者:Shaposhnik,Roman,Martella,Claudio,Logothetis,Dionysios”,我试图从中尝试在第111页(Twitter关注者图)上运行第一个示例。

Defining the Shell Environment for Giraph Execution 定义执行Giraph的Shell环境

$export HADOOP_HOME=/usr/lib/hadoop
$export GIRAPH_HOME=/usr/local/giraph
$export HADOOP_CONF_DIR=$GIRAPH_HOME/conf
$PATH=$HADOOP_HOME/bin:$GIRAPH_HOME/bin:$PATH

Running the Giraph Application 运行Giraph应用程序

$ giraph target/*.jar GiraphHelloWorld -vip src/main/resources/1
-vif org.apache.giraph.io.formats.IntIntNullTextInputFormat
-w 1 -ca giraph.SplitMasterWorker=false,giraph.logLevel=error

I created both jar file and java program in /home/cloudera/target folder and the graph txt is created in src/main/resources/1. 我在/ home / cloudera / target文件夹中创建了jar文件和Java程序,并在src / main / resources / 1中创建了图形txt。

I am facing the below attached error after running the above commands with the below attached program. 使用以下附件程序运行上述命令后,我遇到以下附件错误。

   https://i.stack.imgur.com/tAQaT.jpg  (Error1)
   https://i.stack.imgur.com/GqY2O.jpg  (Error2)
   https://i.stack.imgur.com/ATacy.jpg  (Java Program)

Please let me know if anything else is needed. 请让我知道是否还有其他需要。

The issue with the above error was the process in which the jar file and class were created. 出现上述错误的问题是创建jar文件和类的过程。 It needs to be created in Eclipse with a new Maven Project. 它需要使用新的Maven项目在Eclipse中创建。 I created my own pom file, java program and build the project. 我创建了自己的pom文件,java程序并构建了项目。

Once it was successful in creating jars and classes, I then tried to run the GiraphHelloWorld example by following a systematic approach as before. 一旦成功创建了jar和类,我便尝试按照以前的系统方法来运行GiraphHelloWorld示例。 Also make sure to provide the HADOOP_CLASSPATH to the folder which contains "classes" folder. 还请确保将HADOOP_CLASSPATH提供给包含“ classes”文件夹的文件夹。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM