3

I am trying to run an existing UIMA Ruta analysis engine from a UIMAFIT simple pipeline using the following code:

File specFile = new File("MyEngine.xml");
XMLInputSource in = new XMLInputSource(specFile);
ResourceSpecifier specifier = UIMAFramework.getXMLParser().parseResourceSpecifier(in);
AnalysisEngineDescription aed = (AnalysisEngineDescription) specifier;
builder.add(aed); // Builder is an aggregateBuilder

Upon running it, it resolves imports from the engine's main script (the Cleartk Stanford tools) and then quits with the following exception:

Exception in thread "main" java.lang.NoSuchMethodError: org.apache.uima.ruta.type.RutaBasic.setLowMemoryProfile(Z)V
at org.apache.uima.ruta.RutaStream.initalizeBasics(RutaStream.java:173)
at org.apache.uima.ruta.engine.RutaEngine.initializeStream(RutaEngine.java:575)
at org.apache.uima.ruta.engine.RutaEngine.process(RutaEngine.java:432)
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)
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.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.uimafit.pipeline.SimplePipeline.runPipeline(SimplePipeline.java:80)
at org.myproject.workflow.ParagraphAnnotationPipeline.main(ParagraphAnnotationPipeline.java:107)

The engine was created using a pre-release of Ruta 2.2.0 and the pipeline runs in UIMA 2.5.0 using UIMAFIT 2.0.0 and Ruta-core 2.1.0 imported using maven.

Thanks for any help!

4

1 回答 1

3

这个问题很可能是由 JCas 类被覆盖的事实引起的。UIMA Ruta 提供了一些为播种、推理和附加分析引擎定义的类型的 JCas 类。其中之一(至少,但最重要)包含用于存储有关注释等信息的其他方法:RutaBasic。这些 JCas 类不得被覆盖。

README 中提到了应用 JCasGenPomFriendly 的用户:

If you use the uimaFIT JCasGenPomFriendly in Maven and want to use UIMA Ruta 
as a standalone annotator you have to exclude the generated UIMA Ruta basic 
type files from the build, e.g., by adding:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-compiler-plugin</artifactId>
  <version>3.0</version>
  <configuration>
     <excludes>
         <exclude>org/apache/uima/ruta/type/*.java</exclude>
     </excludes>
  </configuration>
</plugin> 

请检查您是否生成了 RutaBasic 以及该类是否包含例如方法 setLowMemoryProfile。

于 2014-03-04T09:23:54.743 回答