0

嘿,我是 groovy 的极端贵族,我刚刚发现它存在。我将它安装在 centos 5 系统上,这些是版本

Groovy Version: 2.3.0 JVM: 1.7.0_55 Vendor: Oracle Corporation OS: Linux

然后我尝试运行在这里找到的一个简单脚本,而无需下载或安装或包含任何其他内容。运行失败,结果如下。我究竟做错了什么?

    SEVERE: Exception occurred
org.apache.uima.analysis_engine.AnalysisEngineProcessException: Annotator processing failed.
        at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(PrimitiveAnalysisEngine_impl.java:394)
        at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.processAndOutputNewCASes(PrimitiveAnalysisEngine_impl.java:298)
        at org.apache.uima.analysis_engine.asb.impl.ASB_impl$AggregateCasIterator.processUntilNextOutputCas(ASB_impl.java:568)
        at org.apache.uima.analysis_engine.asb.impl.ASB_impl$AggregateCasIterator.<init>(ASB_impl.java:410)
        at org.apache.uima.analysis_engine.asb.impl.ASB_impl.process(ASB_impl.java:343)
        at org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.processAndOutputNewCASes(AggregateAnalysisEngine_impl.java:265)
        at org.apache.uima.analysis_engine.impl.AnalysisEngineImplBase.process(AnalysisEngineImplBase.java:267)
        at org.apache.uima.fit.pipeline.SimplePipeline.runPipeline(SimplePipeline.java:170)
        at org.apache.uima.fit.pipeline.SimplePipeline.runPipeline(SimplePipeline.java:191)
        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.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
        at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.invoke(StaticMetaMethodSite.java:43)
        at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.callStatic(StaticMetaMethodSite.java:99)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallStatic(CallSiteArray.java:53)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:157)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:177)
        at gvy.run(gvy.gvy:22)
        at groovy.lang.GroovyShell.runScriptOrMainOrTestOrRunnable(GroovyShell.java:258)
        at groovy.lang.GroovyShell.run(GroovyShell.java:502)
        at groovy.lang.GroovyShell.run(GroovyShell.java:491)
        at groovy.ui.GroovyMain.processOnce(GroovyMain.java:627)
        at groovy.ui.GroovyMain.run(GroovyMain.java:379)
        at groovy.ui.GroovyMain.process(GroovyMain.java:365)
        at groovy.ui.GroovyMain.processArgs(GroovyMain.java:124)
        at groovy.ui.GroovyMain.main(GroovyMain.java:104)
        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.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:106)
        at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:128)
Caused by: org.apache.uima.cas.CASRuntimeException: JCas type "de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Token" used in Java code,  but was not declared in the XML type descriptor.
        at org.apache.uima.jcas.impl.JCasImpl.getType(JCasImpl.java:412)
        at org.apache.uima.jcas.cas.TOP.<init>(TOP.java:92)
        at org.apache.uima.jcas.cas.AnnotationBase.<init>(AnnotationBase.java:53)
        at org.apache.uima.jcas.tcas.Annotation.<init>(Annotation.java:54)
        at de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Token.<init>(Token.java:53)
        at de.tudarmstadt.ukp.dkpro.core.api.segmentation.SegmenterBase.createToken(SegmenterBase.java:241)
        at de.tudarmstadt.ukp.dkpro.core.stanfordnlp.StanfordSegmenter.process(StanfordSegmenter.java:93)
        at de.tudarmstadt.ukp.dkpro.core.api.segmentation.SegmenterBase.process(SegmenterBase.java:124)
        at org.apache.uima.analysis_component.JCasAnnotator_ImplBase.process(JCasAnnotator_ImplBase.java:48)
        at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(PrimitiveAnalysisEngine_impl.java:378)
        ... 34 more

May 07, 2014 12:36:27 AM org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl processAndOutputNewCASes(273)
SEVERE: Exception occurred
org.apache.uima.analysis_engine.AnalysisEngineProcessException: Annotator processing failed.
        at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(PrimitiveAnalysisEngine_impl.java:394)
        at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.processAndOutputNewCASes(PrimitiveAnalysisEngine_impl.java:298)
        at org.apache.uima.analysis_engine.asb.impl.ASB_impl$AggregateCasIterator.processUntilNextOutputCas(ASB_impl.java:568)
        at org.apache.uima.analysis_engine.asb.impl.ASB_impl$AggregateCasIterator.<init>(ASB_impl.java:410)
        at org.apache.uima.analysis_engine.asb.impl.ASB_impl.process(ASB_impl.java:343)
        at org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.processAndOutputNewCASes(AggregateAnalysisEngine_impl.java:265)
        at org.apache.uima.analysis_engine.impl.AnalysisEngineImplBase.process(AnalysisEngineImplBase.java:267)
        at org.apache.uima.fit.pipeline.SimplePipeline.runPipeline(SimplePipeline.java:170)
        at org.apache.uima.fit.pipeline.SimplePipeline.runPipeline(SimplePipeline.java:191)
        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.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
        at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.invoke(StaticMetaMethodSite.java:43)
        at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.callStatic(StaticMetaMethodSite.java:99)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallStatic(CallSiteArray.java:53)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:157)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:177)
        at gvy.run(gvy.gvy:22)
        at groovy.lang.GroovyShell.runScriptOrMainOrTestOrRunnable(GroovyShell.java:258)
        at groovy.lang.GroovyShell.run(GroovyShell.java:502)
        at groovy.lang.GroovyShell.run(GroovyShell.java:491)
        at groovy.ui.GroovyMain.processOnce(GroovyMain.java:627)
        at groovy.ui.GroovyMain.run(GroovyMain.java:379)
        at groovy.ui.GroovyMain.process(GroovyMain.java:365)
        at groovy.ui.GroovyMain.processArgs(GroovyMain.java:124)
        at groovy.ui.GroovyMain.main(GroovyMain.java:104)
        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.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:106)
        at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:128)
Caused by: org.apache.uima.cas.CASRuntimeException: JCas type "de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Token" used in Java code,  but was not declared in the XML type descriptor.
        at org.apache.uima.jcas.impl.JCasImpl.getType(JCasImpl.java:412)
        at org.apache.uima.jcas.cas.TOP.<init>(TOP.java:92)
        at org.apache.uima.jcas.cas.AnnotationBase.<init>(AnnotationBase.java:53)
        at org.apache.uima.jcas.tcas.Annotation.<init>(Annotation.java:54)
        at de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Token.<init>(Token.java:53)
        at de.tudarmstadt.ukp.dkpro.core.api.segmentation.SegmenterBase.createToken(SegmenterBase.java:241)
        at de.tudarmstadt.ukp.dkpro.core.stanfordnlp.StanfordSegmenter.process(StanfordSegmenter.java:93)
        at de.tudarmstadt.ukp.dkpro.core.api.segmentation.SegmenterBase.process(SegmenterBase.java:124)
        at org.apache.uima.analysis_component.JCasAnnotator_ImplBase.process(JCasAnnotator_ImplBase.java:48)
        at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(PrimitiveAnalysisEngine_impl.java:378)
        ... 34 more

Caught: org.apache.uima.analysis_engine.AnalysisEngineProcessException: Annotator processing failed.
org.apache.uima.analysis_engine.AnalysisEngineProcessException: Annotator processing failed.
        at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(PrimitiveAnalysisEngine_impl.java:394)
        at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.processAndOutputNewCASes(PrimitiveAnalysisEngine_impl.java:298)
        at org.apache.uima.analysis_engine.asb.impl.ASB_impl$AggregateCasIterator.processUntilNextOutputCas(ASB_impl.java:568)
        at org.apache.uima.analysis_engine.asb.impl.ASB_impl$AggregateCasIterator.<init>(ASB_impl.java:410)
        at org.apache.uima.analysis_engine.asb.impl.ASB_impl.process(ASB_impl.java:343)
        at org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.processAndOutputNewCASes(AggregateAnalysisEngine_impl.java:265)
        at org.apache.uima.analysis_engine.impl.AnalysisEngineImplBase.process(AnalysisEngineImplBase.java:267)
        at org.apache.uima.fit.pipeline.SimplePipeline.runPipeline(SimplePipeline.java:170)
        at org.apache.uima.fit.pipeline.SimplePipeline.runPipeline(SimplePipeline.java:191)
        at gvy.run(gvy.gvy:22)
Caused by: org.apache.uima.cas.CASRuntimeException: JCas type "de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Token" used in Java code,  but was not declared in the XML type descriptor.
        at org.apache.uima.jcas.impl.JCasImpl.getType(JCasImpl.java:412)
        at org.apache.uima.jcas.cas.TOP.<init>(TOP.java:92)
        at org.apache.uima.jcas.cas.AnnotationBase.<init>(AnnotationBase.java:53)
        at org.apache.uima.jcas.tcas.Annotation.<init>(Annotation.java:54)
        at de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Token.<init>(Token.java:53)
        at de.tudarmstadt.ukp.dkpro.core.api.segmentation.SegmenterBase.createToken(SegmenterBase.java:241)
        at de.tudarmstadt.ukp.dkpro.core.stanfordnlp.StanfordSegmenter.process(StanfordSegmenter.java:93)
        at de.tudarmstadt.ukp.dkpro.core.api.segmentation.SegmenterBase.process(SegmenterBase.java:124)
        at org.apache.uima.analysis_component.JCasAnnotator_ImplBase.process(JCasAnnotator_ImplBase.java:48)
        at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(PrimitiveAnalysisEngine_impl.java:378)
        ... 9 more
4

1 回答 1

1

Groovy 2.3 似乎有问题。我可以用这个配置重现问题:

Groovy Version: 2.3.0 JVM: 1.8.0 Vendor: Oracle Corporation OS: Mac OS X

但是,这些配置对我有用:

Groovy Version: 2.1.8 JVM: 1.8.0 Vendor: Oracle Corporation OS: Mac OS X
Groovy Version: 2.2.2 JVM: 1.8.0 Vendor: Oracle Corporation OS: Mac OS X

感谢您报告此问题,我们将尝试追踪此问题。同时,请使用 Groovy 2.1.x 或 2.2.x。

披露:我是 DKPro Core 的开发人员,也是上述脚本的作者。

于 2014-05-07T06:31:01.000 回答