uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Renaud Richardet <renaud.richar...@gmail.com>
Subject looking for more informative exception messages when parsing invalid Ruta script
Date Thu, 16 Jul 2015 21:46:20 GMT

When using Ruta in a non-Workbench setup (in my case, Maven), I don't
manage to catch Ruta script errors in a meaningful way. Here is an example:

"aaa\." -> MyAnnotation; // fails because of escaped dot

The thrown error is quite uninformative:

java.lang.ArrayIndexOutOfBoundsException: -1

at org.apache.uima.ruta.parser.RutaParser.emitErrorMessage(

at org.apache.uima.ruta.parser.RutaParser.reportError(RutaParser.java:386)

at org.antlr.runtime.BaseRecognizer.recoverFromMismatchedToken(

at org.antlr.runtime.BaseRecognizer.match(BaseRecognizer.java:115)

at org.apache.uima.ruta.parser.RutaParser.file_input(RutaParser.java:680)

at org.apache.uima.ruta.engine.RutaEngine.loadScript(RutaEngine.java:1058)

at org.apache.uima.ruta.engine.RutaEngine.initializeScript(


Here is the code to reproduce:

However, if I paste that script line in the Ruta Workbench, it nicely
underlines it in red at the exact location, and even says "Mismatched
input". How do I achieve the same programatically (from Java)?

Thanks, Renaud

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