Question

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!

Was it helpful?

Solution

This problem is most likely caused by the fact that the JCas classes are overwritten. UIMA Ruta provides a few JCas classes of the types defined for seeding, inference and additional analysis engines. One of them (at least, but most important) contains additional methods for storing information about annotations and more: RutaBasic. These JCas classes must not be overwritten.

There is a mention in the README for users that apply 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> 

Can you please check if you generated RutaBasic and if the class contains for example the method setLowMemoryProfile.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top