Hi,
I need to take a closer look, but my first guess would be that it should
simply not be allowed to use Ruta/UIMA in the way the test does: create
an AnalysisEngine and then the CAs with CasCreationUtils. Or maybe I
just not yet understant the cause of the problem.
In this case it would really be helpful if I can debug the test with
UIMA v3. Is it an option to commit the changes to some branch?
Peter
Am 05.01.2017 um 19:50 schrieb Marshall Schor:
> One test, NewCASPipelineTest, fails in v3, on line 117.
>
> This failure doesn't happen when UIMA v3 is run in the mode where it doesn't
> cache Type systems.
>
> Type systems, when committed, are "read-only" and sharable, and not changeable
> (after commit).
> In UIMA v3, committed type systems are "cached" and reused when another type
> system is committed which is "equal" to an existing type system.
>
> This is normally invisible to users, but has one side effect: It is possible
> to
> create references to Type and Feature instances as the type system is being
> constructed, before a type system is committed. Once the type system is
> committed, if it turns out that an identical one was cached, that one is used,
> and any previously computed Type and Feature refs will now point off into
> objects that are not part of the type system being used. The work-around is
> simply to re-obtain these references from the committed type system. Some
> tests
> in the core code needed this kind of updating, and I'm wondering if something
> like this is causing this failure.
>
> Here are details: The error stack trace:
>
> Caused by: java.lang.IllegalArgumentException: Not able to resolve type:
> uima.tcas.DocumentAnnotation
> at
> org.apache.uima.ruta.expression.type.SimpleTypeExpression.getType(SimpleTypeExpression.java:48)
> at
> org.apache.uima.ruta.rule.RutaTypeMatcher.getType(RutaTypeMatcher.java:291)
> at
> org.apache.uima.ruta.rule.RutaTypeMatcher.getTypes(RutaTypeMatcher.java:305)
> at
> org.apache.uima.ruta.rule.RutaTypeMatcher.getMatchingAnnotations(RutaTypeMatcher.java:66)
> at
> org.apache.uima.ruta.rule.RutaRuleElement.getAnchors(RutaRuleElement.java:52)
> at
> org.apache.uima.ruta.rule.RutaRuleElement.startMatch(RutaRuleElement.java:59)
> at
> org.apache.uima.ruta.rule.ComposedRuleElement.startMatch(ComposedRuleElement.java:74)
> at org.apache.uima.ruta.rule.RutaRule.apply(RutaRule.java:63)
> at
> org.apache.uima.ruta.block.RutaScriptBlock.apply(RutaScriptBlock.java:48)
> at org.apache.uima.ruta.RutaModule.apply(RutaModule.java:56)
> at org.apache.uima.ruta.engine.RutaEngine.process(RutaEngine.java:495)
>
> line 117 is the 4th call to SimplePipeline.runPipeline. It is different in
> that
> the ae is set up to not reload the Ruta script:
>
> // create a new cas and do not force the ae to update its types
> ae.setConfigParameterValue(RutaEngine.PARAM_RELOAD_SCRIPT, false);
>
> This is causing the Ruta "environments" to not find
> "uima.tcas.DocummentAnnotation" in the parent RutaBlock environment context:
>
> public Type getType(MatchContext context, RutaStream stream) {
> RutaBlock parent = context.getParent();
> Type type = parent.getEnvironment().getType(typeString);
>
> type is null, at this point, causing the error.
>
> Any idea what needs to be properly initialized, to fix this issue when running
> with v3 with Type System caching enabled?
>
> Thanks for any insights. -Marshall
>
>