在我的项目中运行giraph作业时未找到类异常

68de4m5k  于 2021-06-03  发布在  Hadoop
关注(0)|答案(0)|浏览(280)

我写了自己的计算(mergecomputation)。当我在单个节点上运行我的项目时,我得到错误java.lang.classnotfoundexception。
以下是我加载的方式:

GiraphConfiguration conf = new GiraphConfiguration();

conf.setComputationClass(MergeComputation.class);

我尝试了所有可能的方法:

bin/hadoop jar contrail-1.0-SNAPSHOT-job.jar contrail.GraphMerge giraphIn giraphout 2 -libjars myproject.jar,giraph-1.1.0-SNAPSHOT-for-hadoop-1.0.2-jar-with-dependencies.jar

我的hadoop\u类路径:

/Users/vidyasagar/Documents/hadoop-1.1.2/libexec/../giraph-1.1.0-SNAPSHOT-for-hadoop-1.0.2-jar-with-dependencies.jar:/Users/vidyasagar/Documents/hadoop-1.1.2/libexec/../myProject.jar

我有以下错误

java.lang.RuntimeException: java.lang.RuntimeException: java.lang.ClassNotFoundException: contrail.MergeComputation
    at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:881)
    at org.apache.giraph.conf.ClassConfOption.get(ClassConfOption.java:108)
    at org.apache.giraph.utils.ConfigurationUtils.getTypesHolderClass(ConfigurationUtils.java:144)
    at org.apache.giraph.conf.GiraphTypes.readFrom(GiraphTypes.java:97)
    at org.apache.giraph.conf.GiraphClasses.<init>(GiraphClasses.java:155)
    at org.apache.giraph.conf.ImmutableClassesGiraphConfiguration.<init>(ImmutableClassesGiraphConfiguration.java:99)
    at org.apache.giraph.bsp.BspOutputFormat.getOutputCommitter(BspOutputFormat.java:56)
    at org.apache.hadoop.mapred.Task.initialize(Task.java:515)
    at org.apache.hadoop.mapred.MapTask.run(MapTask.java:353)
    at org.apache.hadoop.mapred.Child$4.run(Child.java:255)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:396)
    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1149)
    at org.apache.hadoop.mapred.Child.main(Child.java:249)
Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: contrail.MergeComputation
    at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:849)
    at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:873)
    ... 13 more
Caused by: java.lang.ClassNotFoundException: contrail.MergeComputation
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:247)
    at org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:802)
    at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:847)
    ... 14 more

有人能帮我吗。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题