0
我正在提供我的jar作爲依賴關係,以啓動Zeppelin的解釋器。在運行包含上述jar的服務調用的筆記本時,筆記本保持錯誤狀態。以下異常飛艇日誌顯示:Zeppelin:運行筆記本時出錯
Caused by: java.lang.NoClassDefFoundError: scala/reflect/internal/AnnotationInfos$ErroneousAnnotation$
at scala.tools.nsc.interpreter.ReplGlobal$$anon$1.newTyper(ReplGlobal.scala:34)
at scala.tools.nsc.typechecker.Namers$Namer.<init>(Namers.scala:58)
at scala.tools.nsc.typechecker.Namers$NormalNamer.<init>(Namers.scala:50)
at scala.tools.nsc.typechecker.Namers$class.newNamer(Namers.scala:51)
at scala.tools.nsc.interpreter.ReplGlobal$$anon$1.newNamer(ReplGlobal.scala:23)
at scala.tools.nsc.typechecker.Analyzer$namerFactory$$anon$1.apply(Analyzer.scala:43)
at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:430)
at scala.tools.nsc.Global$GlobalPhase$$anonfun$run$1.apply(Global.scala:397)
at scala.tools.nsc.Global$GlobalPhase$$anonfun$run$1.apply(Global.scala:397)
at scala.collection.Iterator$class.foreach(Iterator.scala:893)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1336)
at scala.tools.nsc.Global$GlobalPhase.run(Global.scala:397)
at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1625)
at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1610)
at scala.tools.nsc.Global$Run.compileSources(Global.scala:1605)
at scala.tools.nsc.interpreter.IMain.compileSourcesKeepingRun(IMain.scala:388)
at scala.tools.nsc.interpreter.IMain$ReadEvalPrint.compileAndSaveRun(IMain.scala:804)
at scala.tools.nsc.interpreter.IMain$ReadEvalPrint.compile(IMain.scala:763)
at scala.tools.nsc.interpreter.IMain$Request.compile$lzycompute(IMain.scala:939)
at scala.tools.nsc.interpreter.IMain$Request.compile(IMain.scala:934)
at scala.tools.nsc.interpreter.IMain.compile(IMain.scala:531)
at scala.tools.nsc.interpreter.IMain.interpret(IMain.scala:519)
at scala.tools.nsc.interpreter.IMain.interpret(IMain.scala:517)
... 18 more
只給約罐子簡短的想法,它基本上是閱讀和使用星火流寫入到卡夫卡。
代碼是用Scala編寫的,我用Gradle構建了一個Fat-jar。 奇怪的是,當我使用SBT構建jar時,它工作正常(使用程序集插件)。 這裏是我的搖籃文件:
plugins {
id "com.github.johnrengelman.shadow" version "1.2.3"
}
group 'com.demo'
version '1.0-SNAPSHOT'
apply plugin: 'java'
apply plugin: 'scala'
sourceCompatibility = 1.8
configurations { providedCompile }
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
providedCompile group: 'org.apache.spark', name: 'spark-core_2.11', version: '2.0.0'
providedCompile group: 'org.apache.spark', name: 'spark-sql_2.11', version: '2.0.0'
compile group: 'org.apache.spark', name: 'spark-streaming_2.11', version: '2.0.0'
compile group: 'org.apache.spark', name: 'spark-streaming-kafka_2.11', version: '1.6.2'
compile group: 'org.apache.spark', name: 'spark-catalyst_2.11', version: '2.0.0'
compile group: 'org.apache.kafka', name: 'kafka_2.11', version: '0.9.0.1'
compile group: 'org.apache.kafka', name: 'kafka-clients', version: '0.9.0.1'
testCompile group: 'junit', name: 'junit', version: '4.11'
}
shadowJar {
zip64 true
}
build.dependsOn(shadowJar);
sourceSets.main.compileClasspath += configurations.providedCompile
sourceSets.test.compileClasspath += configurations.providedCompile
sourceSets.test.runtimeClasspath += configurations.providedCompile