uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From William Colen <william.co...@gmail.com>
Subject Error using RUTA from Java
Date Wed, 20 May 2015 19:45:44 GMT
Hello,

We have a Main RUTA script that imports a few children scripts, as follows:

PACKAGE cogroo.ruta;
> TYPESYSTEM BaseTypeSystem;
> IMPORT opennlp.uima.Token FROM TypeSystem AS cgToken;
> IMPORT opennlp.uima.Sentence FROM TypeSystem AS cgSentence;
> SCRIPT Crase;
> SCRIPT Base;
> Document{-> CALL(Base)};
> Document{-> CALL(Crase)};


All the scripts are in the root of the classpath.

We are trying to call it from Java, using the following code:

TypeSystemDescription tsd =
> TypeSystemDescriptionFactory.createTypeSystemDescription("MainTypeSystem"
> );
> URL url = Resources.getResource("Main.ruta");
> String scriptText = Resources.toString(url, Charsets.UTF_8);
> AnalysisEngineDescription aeDes =
> Ruta.createAnalysisEngineDescription(scriptText, tsd);
> AnalysisEngine ae = UIMAFramework.produceAnalysisEngine(aeDes);


 The error we are getting:

org.apache.uima.analysis_engine.AnalysisEngineProcessException: Annotator
> processing failed.
> at
> org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(PrimitiveAnalysisEngine_impl.java:401)
> at
> org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.processAndOutputNewCASes(PrimitiveAnalysisEngine_impl.java:309)
> at
> org.apache.uima.analysis_engine.impl.AnalysisEngineImplBase.process(AnalysisEngineImplBase.java:267)
> at org.cogroo.tools.checker.checkers.UIMAChecker.check(UIMAChecker.java:74)
> at org.cogroo.tools.checker.checkers.UIMAChecker.check(UIMAChecker.java:1)
> at
> org.cogroo.tools.checker.TypedCheckerComposite.check(TypedCheckerComposite.java:49)
> at org.cogroo.checker.GrammarChecker.analyze(GrammarChecker.java:252)
> at org.cogroo.checker.GrammarChecker.analyze(GrammarChecker.java:271)
> at org.cogroo.tools.checker.checkers.UIMAChecker.main(UIMAChecker.java:131)
> Caused by: java.lang.NullPointerException
> at
> org.apache.uima.ruta.engine.RutaEngine.resetEnvironment(RutaEngine.java:529)
> at
> org.apache.uima.ruta.engine.RutaEngine.resetEnvironments(RutaEngine.java:524)
> at org.apache.uima.ruta.engine.RutaEngine.process(RutaEngine.java:480)
> 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:385)
> ... 8 more


We have a feeling that RUTA can't find the child script files, and that
causes the error. Are we missing something?


Thank you,
William

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message