2013-11-26 191 views
0

我試圖運行Word的快速啓動頁面數例如scoobi字計數例如當拋出java.lang.ClassNotFoundException:類scala.runtime.Nothing運行

import com.nicta.scoobi.Scoobi._ 
import Reduction._ 

object WordCount extends ScoobiApp { 
    def run() { 
    val lines = fromTextFile(args(0)) 

    val counts = lines.mapFlatten(_.split(" ")) 
     .map(word => (word, 1)) 
     .groupByKey 
     .combine(Sum.int) 
    counts.toTextFile(args(1)).persist 
    } 
} 

,當我在使用它工作正常內存模式,而是試圖本地模式(或羣集模式),當我失敗與錯誤:

[WARN] LocalJobRunner - job_local_0001 <java.lang.RuntimeException: java.lang.ClassNotFoundException: Class scala.runtime.Nothing$ not found>java.lang.RuntimeException: java.lang.ClassNotFoundException: Class scala.runtime.Nothing$ not found 
     at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:1439) 
     at com.nicta.scoobi.impl.mapreducer.ChannelOutputFormat.com$nicta$scoobi$impl$mapreducer$ChannelOutputFormat$$mkTaskContext$1(ChannelOutputFormat.scala:63) 
     at com.nicta.scoobi.impl.mapreducer.ChannelOutputFormat$$anonfun$getContext$1.apply(ChannelOutputFormat.scala:75) 
     at com.nicta.scoobi.impl.mapreducer.ChannelOutputFormat$$anonfun$getContext$1.apply(ChannelOutputFormat.scala:75) 
     at scala.collection.mutable.MapLike$class.getOrElseUpdate(MapLike.scala:189) 
     at scala.collection.mutable.AbstractMap.getOrElseUpdate(Map.scala:91) 
     at com.nicta.scoobi.impl.mapreducer.ChannelOutputFormat.getContext(ChannelOutputFormat.scala:75) 
     at com.nicta.scoobi.impl.mapreducer.ChannelOutputFormat.write(ChannelOutputFormat.scala:43) 
     at com.nicta.scoobi.impl.plan.mscr.MscrOutputChannel$$anon$5$$anonfun$write$1.apply(OutputChannel.scala:137) 
     at com.nicta.scoobi.impl.plan.mscr.MscrOutputChannel$$anon$5$$anonfun$write$1.apply(OutputChannel.scala:135) 
     at scala.collection.immutable.List.foreach(List.scala:318) 
     at com.nicta.scoobi.impl.plan.mscr.MscrOutputChannel$$anon$5.write(OutputChannel.scala:135) 
     at com.nicta.scoobi.impl.plan.mscr.GbkOutputChannel$$anonfun$reduce$1.apply$mcV$sp(OutputChannel.scala:201) 
     at com.nicta.scoobi.impl.plan.mscr.GbkOutputChannel$$anonfun$reduce$1.apply(OutputChannel.scala:201) 
     at com.nicta.scoobi.impl.plan.mscr.GbkOutputChannel$$anonfun$reduce$1.apply(OutputChannel.scala:201) 
     at scala.Option.getOrElse(Option.scala:120) 
     at com.nicta.scoobi.impl.plan.mscr.GbkOutputChannel.reduce(OutputChannel.scala:200) 
     at com.nicta.scoobi.impl.mapreducer.MscrReducer$$anonfun$reduce$1.apply(MscrReducer.scala:55) 
     at com.nicta.scoobi.impl.mapreducer.MscrReducer$$anonfun$reduce$1.apply(MscrReducer.scala:52) 
     at scala.Option.foreach(Option.scala:236) 
     at com.nicta.scoobi.impl.mapreducer.MscrReducer.reduce(MscrReducer.scala:52) 
     at com.nicta.scoobi.impl.mapreducer.MscrReducer.reduce(MscrReducer.scala:33) 
     at org.apache.hadoop.mapreduce.Reducer.run(Reducer.java:164) 
     at org.apache.hadoop.mapred.ReduceTask.runNewReducer(ReduceTask.java:572) 
     at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:414) 
     at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:309) 
Caused by: java.lang.ClassNotFoundException: Class scala.runtime.Nothing$ not found 
     at org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:1350) 
     at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:1437) 
     ... 25 more 

[INFO] TrackerDistributedCacheManager - Deleted path /tmp/scoobi-root/WordCount$-1124-035523--1298047809/step1 of 1/archive/3757970833182018747_-1642337927_156373685/file/tmp/scoobi-root/WordCount$-1124-035523--1298047809/dist-objs/scoobi.combiners-step1 of 1 
[INFO] TrackerDistributedCacheManager - Deleted path /tmp/scoobi-root/WordCount$-1124-035523--1298047809/step1 of 1/archive/1307074498433974065_910223079_156373685/file/tmp/scoobi-root/WordCount$-1124-035523--1298047809/dist-objs/scoobi.mappers-step1 of 1 
[INFO] TrackerDistributedCacheManager - Deleted path /tmp/scoobi-root/WordCount$-1124-035523--1298047809/step1 of 1/archive/-624792843022440048_-470268278_156372685/file/tmp/scoobi-root/WordCount$-1124-035523--1298047809/dist-objs/scoobi.metadata.TG23 
[INFO] TrackerDistributedCacheManager - Deleted path /tmp/scoobi-root/WordCount$-1124-035523--1298047809/step1 of 1/archive/-7527273518266336656_-470264434_156372685/file/tmp/scoobi-root/WordCount$-1124-035523--1298047809/dist-objs/scoobi.metadata.TK23 
[INFO] TrackerDistributedCacheManager - Deleted path /tmp/scoobi-root/WordCount$-1124-035523--1298047809/step1 of 1/archive/-7162952586058180219_-470259629_156372685/file/tmp/scoobi-root/WordCount$-1124-035523--1298047809/dist-objs/scoobi.metadata.TP23 
[INFO] TrackerDistributedCacheManager - Deleted path /tmp/scoobi-root/WordCount$-1124-035523--1298047809/step1 of 1/archive/-1228551315878554095_-470253863_156372685/file/tmp/scoobi-root/WordCount$-1124-035523--1298047809/dist-objs/scoobi.metadata.TV23 
[INFO] TrackerDistributedCacheManager - Deleted path /tmp/scoobi-root/WordCount$-1124-035523--1298047809/step1 of 1/archive/6598684265640022340_1943382592_156373685/file/tmp/scoobi-root/WordCount$-1124-035523--1298047809/dist-objs/scoobi.reducers-step1 of 1 
[INFO] TrackerDistributedCacheManager - Deleted path /tmp/scoobi-root/WordCount$-1124-035523--1298047809/step1 of 1/archive/1699308645513763631_1905624154_156371685/file/tmp/scoobi-root/WordCount$-1124-035523--1298047809/env/a88809af-334b-499e-bafc-1a2ebeffdfbd 
[INFO] MapReduceJob - Map 100% Reduce 0% 
[error] (run-main) com.nicta.scoobi.impl.exec.JobExecException: MapReduce job 'job_local_0001' failed! Please see http://localhost:8080/ for more info. 
com.nicta.scoobi.impl.exec.JobExecException: MapReduce job 'job_local_0001' failed! Please see http://localhost:8080/ for more info. 
     at com.nicta.scoobi.impl.exec.MapReduceJob.report(MapReduceJob.scala:80) 
     at com.nicta.scoobi.impl.exec.HadoopMode$Execution$$anonfun$reportMscr$1.apply(HadoopMode.scala:157) 
     at com.nicta.scoobi.impl.exec.HadoopMode$Execution$$anonfun$reportMscr$1.apply(HadoopMode.scala:154) 
     at scala.Function2$$anonfun$tupled$1.apply(Function2.scala:54) 
     at scala.Function2$$anonfun$tupled$1.apply(Function2.scala:53) 
     at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) 
     at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) 
     at scala.collection.immutable.List.foreach(List.scala:318) 
     at scala.collection.TraversableLike$class.map(TraversableLike.scala:244) 
     at scala.collection.AbstractTraversable.map(Traversable.scala:105) 
     at com.nicta.scoobi.impl.exec.HadoopMode$Execution.runMscrs(HadoopMode.scala:133) 
     at com.nicta.scoobi.impl.exec.HadoopMode$Execution.execute(HadoopMode.scala:115) 
     at com.nicta.scoobi.impl.exec.HadoopMode$$anonfun$executeLayer$1.apply(HadoopMode.scala:105) 
     at com.nicta.scoobi.impl.exec.HadoopMode$$anonfun$executeLayer$1.apply(HadoopMode.scala:104) 
     at org.kiama.attribution.AttributionCore$CachedAttribute.apply(AttributionCore.scala:61) 
     at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) 
     at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) 
     at scala.collection.immutable.List.foreach(List.scala:318) 
     at scala.collection.TraversableLike$class.map(TraversableLike.scala:244) 
     at scala.collection.AbstractTraversable.map(Traversable.scala:105) 
     at com.nicta.scoobi.impl.exec.HadoopMode.com$nicta$scoobi$impl$exec$HadoopMode$$executeLayers$1(HadoopMode.scala:68) 
     at com.nicta.scoobi.impl.exec.HadoopMode$$anonfun$executeNode$1.apply(HadoopMode.scala:91) 
     at com.nicta.scoobi.impl.exec.HadoopMode$$anonfun$executeNode$1.apply(HadoopMode.scala:84) 
     at org.kiama.attribution.AttributionCore$CachedAttribute.apply(AttributionCore.scala:61) 
     at scalaz.syntax.IdOps$class.$bar$greater(IdOps.scala:15) 
     at scalaz.syntax.ToIdOps$$anon$1.$bar$greater(IdOps.scala:78) 
     at com.nicta.scoobi.impl.exec.HadoopMode.execute(HadoopMode.scala:52) 
     at com.nicta.scoobi.impl.exec.HadoopMode.execute(HadoopMode.scala:48) 
     at com.nicta.scoobi.impl.Persister.persist(Persister.scala:44) 
     at com.nicta.scoobi.impl.ScoobiConfigurationImpl.persist(ScoobiConfigurationImpl.scala:355) 
     at com.nicta.scoobi.application.Persist$class.persist(Persist.scala:33) 
     at p.WordCount$.persist(scoobi-test.scala:6) 
     at com.nicta.scoobi.application.Persist$PersistableList.persist(Persist.scala:151) 
     at p.WordCount$.run(scoobi-test.scala:14) 
     at com.nicta.scoobi.application.ScoobiApp$$anonfun$main$1.apply$mcV$sp(ScoobiApp.scala:80) 
     at com.nicta.scoobi.application.ScoobiApp$$anonfun$main$1.apply(ScoobiApp.scala:75) 
     at com.nicta.scoobi.application.ScoobiApp$$anonfun$main$1.apply(ScoobiApp.scala:75) 
     at com.nicta.scoobi.application.LocalHadoop$class.runOnLocal(LocalHadoop.scala:41) 
     at p.WordCount$.runOnLocal(scoobi-test.scala:6) 
     at com.nicta.scoobi.application.LocalHadoop$class.executeOnLocal(LocalHadoop.scala:35) 
     at p.WordCount$.executeOnLocal(scoobi-test.scala:6) 
     at com.nicta.scoobi.application.LocalHadoop$$anonfun$onLocal$1.apply(LocalHadoop.scala:29) 
     at com.nicta.scoobi.application.InMemoryHadoop$class.withTimer(InMemory.scala:71) 
     at p.WordCount$.withTimer(scoobi-test.scala:6) 
     at com.nicta.scoobi.application.InMemoryHadoop$class.showTime(InMemory.scala:79) 
     at p.WordCount$.showTime(scoobi-test.scala:6) 
     at com.nicta.scoobi.application.LocalHadoop$class.onLocal(LocalHadoop.scala:29) 
     at p.WordCount$.onLocal(scoobi-test.scala:6) 
     at com.nicta.scoobi.application.Hadoop$class.onHadoop(Hadoop.scala:60) 
     at p.WordCount$.onHadoop(scoobi-test.scala:6) 
     at com.nicta.scoobi.application.ScoobiApp$class.main(ScoobiApp.scala:75) 
     at p.WordCount$.main(scoobi-test.scala:6) 
     at p.WordCount.main(scoobi-test.scala) 
     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:616) 
[trace] Stack trace suppressed: run last compile:runMain for the full output. 
[INFO] Task - Communication exception: java.lang.InterruptedException 
     at java.lang.Object.wait(Native Method) 
     at org.apache.hadoop.mapred.Task$TaskReporter.run(Task.java:648) 
     at java.lang.Thread.run(Thread.java:679) 

java.lang.RuntimeException: Nonzero exit code: 1 
     at scala.sys.package$.error(package.scala:27) 
[trace] Stack trace suppressed: run last compile:runMain for the full output. 
[error] (compile:runMain) Nonzero exit code: 1 
[error] Total time: 9 s, completed Nov 24, 2013 3:55:30 AM 

運行從GitHub非常相似的例子(https://github.com/NICTA/scoobi/tree/SCOOBI-0.7.3/examples/wordCount)做的工作。

有什麼想法?

EDIT 我根據運行示例中scoobi quick start 解釋跑樣品使用完成SBT命令:

sbt compile 
sbt "run-main mypackage.myapp.WordCount input-files output" 

沒有關於如何或在哪裏提供參數,如位置參考的外部罐子。

+0

看起來你出於某種原因沒有classpath上的scala-library.jar。 –

+0

你知道在哪裏提供它嗎?我用一些相關細節更新了這個問題 –

+0

如果你在sbt中運行它,那應該不是問題。 1.你如何在內存中運行它(你提​​到過這個工程); 2.嘗試在sbt compile'之前運行'sbt clean update'。 –

回答

0

安裝的scala版本和build.sbt中指定的版本必須相同。一旦相同,scala-library會自動包含到classpath中。

0

我們最近面臨同樣的問題,並通過將fork := true添加到sbt設置來解決此問題。

相關問題