Apache Zeppelin:如何管理Groovy解释器的依赖项

时间:2019-02-05 15:45:36

标签: groovy apache-zeppelin

我用过Apache Zeppelin 0.8.1

我想要用户Groovy interpreter。并使用@Grape部门管理人员:

%groovy

@Grapes([
    @Grab('com.github.twosigma.beakerx:beaker-kernel-groovy:0.9.0')
])
import com.twosigma.beakerx.widget.IntSlider

但是出现错误:

java.lang.RuntimeException: Failed to parse groovy script: java.lang.NoClassDefFoundError: org/apache/ivy/Ivy
 at org.apache.zeppelin.groovy.GroovyInterpreter.getGroovyScript(GroovyInterpreter.java:140)

合理。根据{{​​3}}的官方文档,我提供了工件深度:org.apache.ivy:ivy:2.5.0-rc1Dependency Management for Interpreter

在存储库中,我启用了具有该工件的Centralenter image description here):

http://repo1.maven.org/maven2/

但是在重新启动解释器和重新加载笔记本时,我得到了错误:Error setting properties for interpreter 'groovy.groovy': Cannot fetch dependencies for org.apache.ivy:ivy:2.5.0-rc1enter image description here

我已经尝试过(作为实验,不是长期解决方案)进入齐柏林飞艇docker container并将enter image description here下载到/zeppelin/interpreter/groovy中,重新启动解释器,重新加载nootebook,这看起来很麻烦。部门-我第二次看到进度条,但随后又出现错误:

java.lang.RuntimeException: Failed to parse groovy script: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: General error during conversion: Error grabbing Grapes -- [unresolved dependency: com.github.twosigma.beakerx#beaker-kernel-groovy;0.9.0: not found] java.lang.RuntimeException: Error grabbing Grapes -- [unresolved dependency: com.github.twosigma.beakerx#beaker-kernel-groovy;0.9.0: not found] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83) at org.codehaus.groovy.reflection.CachedConstructor.doConstructorInvoke(CachedConstructor.java:77) at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrap.callConstructor(ConstructorSite.java:84) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:60) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:235) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:247) at groovy.grape.GrapeIvy.getDependencies(GrapeIvy.groovy:426) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSite.invoke(PogoMetaMethodSite.java:169) at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:59) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:154) at groovy.grape.GrapeIvy.resolve(GrapeIvy.groovy:573) at groovy.grape.GrapeIvy$resolve$1.callCurrent(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:154) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:190) at groovy.grape.GrapeIvy.resolve(GrapeIvy.groovy:540) at groovy.grape.GrapeIvy$resolve$0.callCurrent(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:154) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:182) at groovy.grape.GrapeIvy.grab(GrapeIvy.groovy:258) at groovy.grape.Grape.grab(Grape.java:167) at groovy.grape.GrabAnnotationTransformation.visit(GrabAnnotationTransformation.java:378) at org.codehaus.groovy.transform.ASTTransformationVisitor$3.call(ASTTransformationVisitor.java:321) at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:931) at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:593) at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:569) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:546) at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298) at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268) at groovy.lang.GroovyShell.parseClass(GroovyShell.java:688) at groovy.lang.GroovyShell.parse(GroovyShell.java:700) at groovy.lang.GroovyShell.parse(GroovyShell.java:736) at org.apache.zeppelin.groovy.GroovyInterpreter.getGroovyScript(GroovyInterpreter.java:133) at org.apache.zeppelin.groovy.GroovyInterpreter.interpret(GroovyInterpreter.java:155) at org.apache.zeppelin.interpreter.LazyOpenInterpreter.interpret(LazyOpenInterpreter.java:103) at org.apache.zeppelin.interpreter.remote.RemoteInterpreterServer$InterpretJob.jobRun(RemoteInterpreterServer.java:632) at org.apache.zeppelin.scheduler.Job.run(Job.java:188) at org.apache.zeppelin.scheduler.ParallelScheduler$JobRunner.run(ParallelScheduler.java:162) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) 1 error at org.apache.zeppelin.groovy.GroovyInterpreter.getGroovyScript(GroovyInterpreter.java:140)

groovy似乎没有看到存储库配置,而是尝试仅在本地解决依赖项。

我应该设置些什么来改变它?

1 个答案:

答案 0 :(得分:1)

齐柏林飞艇中的常规设计不支持@profile

您的工件在特定的存储库中

http://maven.imagej.net/content/repositories/public/

检查此工件搜索引擎:

https://mvnrepository.com/artifact/com.github.twosigma.beakerx/beaker-kernel-groovy/0.9.0

所以,只需向齐柏林飞艇中添加一个新的仓库

UPD:

对于@Grab,有很多依赖项已下载 其中之一失败了。这是我在控制台中看到的内容:

org.apache.ivy:ivy:2.5.0-rc1

(IHMO是齐柏林飞艇的错误)

但要使其正常工作

Error while downloading repos for interpreter group : groovy, 
    go to interpreter setting page click on edit and save it again 
    to make this interpreter work properly: 
         Cannot fetch dependencies for org.apache.ivy:ivy:2.5.0-rc1 
    ...
Caused by: org.sonatype.aether.resolution.DependencyResolutionException:
    Could not find artifact com.jcraft:jsch.agentproxy:jar:0.0.9 in central
    (http://repo1.maven.org/maven2/)
   ...