[英]Trouble running a giraph job (classnotfoundexception)
I'm attempting to build the SimpleShortestPathsComputation example included with Giraph and run it from within my home directory. 我正在尝试构建Giraph附带的SimpleShortestPathsComputation示例,并从我的主目录中运行它。 Basically, I'm just trying to tweak the SimpleShortestPaths example and run it without any hassle (not quite sure what the best way to go about that would be).
基本上,我只是尝试调整SimpleShortestPaths示例,然后毫不费力地运行它(不太确定最好的方法是什么)。 My approach was as follows:
我的方法如下:
SimpleShortestPathsComputaiton.java: SimpleShortestPathsComputaiton.java:
import org.apache.giraph.graph.BasicComputation;
......
import org.apache.log4j.Logger;
import java.io.IOException;
public class SimpleShortestPathsComputation extends BasicComputation<
LongWritable, DoubleWritable, FloatWritable, DoubleWritable> {
......
I build it like so: 我这样构建它:
JCC = javac
JFLAGS = "-Xlint"
OUTPUT_CLASS="test"
CLASSPATH = $(HADOOP_HOME)/hadoop-core-0.20.203.0.jar:$(GIRAPH_HOME)/giraph-core/target/giraph-1.1.0-SNAPSHOT-for-hadoop-0.20.203.0-jar-with-dependencies.jar
default: SimpleShortestPathsComputation.class
SimpleShortestPathsComputation.class: SimpleShortestPathsComputation.java
mkdir -p $(OUTPUT_CLASS)
$(JCC) $(JFLAGS) -classpath $(CLASSPATH) -d $(OUTPUT_CLASS) SimpleShortestPathsComputation.java
jar cvf SimpleShortestPathsComputation.jar -C $(OUTPUT_CLASS)/ .
This works fine and I create a jar file named SimpleShortestPathsComputation. 这工作正常,我创建了一个名为SimpleShortestPathsComputation的jar文件。 I then try running it like so:
然后,我尝试像这样运行它:
$HADOOP_HOME/bin/hadoop jar $GIRAPH_HOME/giraph-examples/target/giraph-examples-1.1.0-SNAPSHOT-for-hadoop-0.20.203.0-jar-with-dependencies.jar \
org.apache.giraph.GiraphRunner /home/hduser/SimpleShortestPathsComputation.jar \
-vif org.apache.giraph.io.formats.JsonLongDoubleFloatDoubleVertexInputFormat \
-vip /user/hduser/input/tiny_graph.txt \
-vof org.apache.giraph.io.formats.IdWithValueTextOutputFormat \
-op /user/hduser/output/shortestpaths -w 1 \
/
However, this results in the following: 但是,这导致以下结果:
Exception in thread "main" java.lang.ClassNotFoundException: /home/hduser/SimpleShortestPathsComputation.jar
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:190)
at org.apache.giraph.utils.ConfigurationUtils.handleComputationClass(ConfigurationUtils.java:470)
at org.apache.giraph.utils.ConfigurationUtils.populateGiraphConfiguration(ConfigurationUtils.java:453)
at org.apache.giraph.utils.ConfigurationUtils.parseArgs(ConfigurationUtils.java:207)
at org.apache.giraph.GiraphRunner.run(GiraphRunner.java:74)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:79)
at org.apache.giraph.GiraphRunner.main(GiraphRunner.java:124)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.hadoop.util.RunJar.main(RunJar.java:156)
I'm not quite sure what I'm doing wrong. 我不太确定自己在做什么错。 If anyone can point me in the right direction, or link to a resource that explains an easier way of what I'm trying to accomplish, I'd greatly appreciate it!
如果任何人都可以为我指明正确的方向,或者链接到可以解释我要完成的工作的简便方法的资源,我将不胜感激!
If you are running the " Quick start ", actually there are inconsistency with 1.0.0: 如果您正在运行“ 快速入门 ”,则实际上与1.0.0不一致:
(1) argument "-vof" should have been "-of". (1)参数“ -vof”应为“ -of”。 "-vof" was introduced in 1.1.0 (see GIRAPH-774 ).
1.1.0中引入了“ -vof”(请参阅GIRAPH-774 )。
(2) In 1.0.0, there doesn't exist a class called "org.apache.giraph.examples.SimpleShortestPathsComputation", change it to "org.apache.giraph.examples.SimpleShortestPathsVertex". (2)在1.0.0中,没有名为“ org.apache.giraph.examples.SimpleShortestPathsComputation”的类,请将其更改为“ org.apache.giraph.examples.SimpleShortestPathsVertex”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.