You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@uima.apache.org by Erik Fäßler <er...@uni-jena.de> on 2021/07/27 10:06:14 UTC

RUTA: NPE in RutaLiteralMatcher

Hi everyone,

I have been having an issue with literal matching for quite some time now. In the past, I just replaced all literal matching with word lists. In my current script, however, this would be rather cumbersome.
The error looks like this:

java.lang.NullPointerException: null
	at org.apache.uima.ruta.rule.RutaLiteralMatcher.getAnnotation(RutaLiteralMatcher.java:72)
	at org.apache.uima.ruta.rule.RutaLiteralMatcher.getMatchingAnnotations(RutaLiteralMatcher.java:62)
	at org.apache.uima.ruta.rule.RutaLiteralMatcher.getMatchingAnnotations(RutaLiteralMatcher.java:37)
	at org.apache.uima.ruta.rule.RutaRuleElement.getAnchors(RutaRuleElement.java:52)
	at org.apache.uima.ruta.rule.RutaRuleElement.startMatch(RutaRuleElement.java:60)
	at org.apache.uima.ruta.rule.ComposedRuleElement.startMatch(ComposedRuleElement.java:87)
	at org.apache.uima.ruta.rule.ComposedRuleElement.startMatch(ComposedRuleElement.java:77)
	at org.apache.uima.ruta.rule.RutaRule.apply(RutaRule.java:65)
	at org.apache.uima.ruta.rule.RutaRule.apply(RutaRule.java:56)
	at org.apache.uima.ruta.rule.RutaRule.apply(RutaRule.java:38)
	at org.apache.uima.ruta.block.RutaScriptBlock.apply(RutaScriptBlock.java:72)
	at org.apache.uima.ruta.RutaModule.apply(RutaModule.java:56)
	at org.apache.uima.ruta.engine.RutaEngine.process(RutaEngine.java:612)
	... 11 common frames omitted

So all I know is that something is null. But I have no idea what it could be. I cannot even reproduce the issue in the Eclipse Workbench: The XMI files that cause the error work without issue in Eclipse. The error only occurs when running the CPE with the Ruta component that I created using the Maven plugin.
Hence, I don’t even know what part of my script is causing the error. I have rules like this:

(WS|"("|"/") (Greek|NUM|Roman) {->MARK(Specifier)} (WS|"("|"/“);

which I think could be the cause. But this is based on the fact that I could fix the error with word lists until now. Hints and ideas on how to circumvent this issue are appreciated.

Best,

Erik

Re: RUTA: NPE in RutaLiteralMatcher

Posted by Erik Fäßler <er...@uni-jena.de>.
Hi Peter,

I was still on 2.8.0. I updated to 2.8.1 and it seems to work now.
My bad, I could really have checked for updates, sorry ;-)

Thanks again for all your great effort!

Best,

Erik

> On 27. Jul 2021, at 12:09, Peter Klügl <pk...@gmail.com> wrote:
> 
> Hi Erik,
> 
> 
> which version of Ruta do you use? It looks like you use an old version
> in your maven dependencies, in which this bug hasn't been fixed yet.
> 
> 
> Best,
> 
> 
> Peter
> 
> Am 27.07.2021 um 12:06 schrieb Erik Fäßler:
>> Hi everyone,
>> 
>> I have been having an issue with literal matching for quite some time now. In the past, I just replaced all literal matching with word lists. In my current script, however, this would be rather cumbersome.
>> The error looks like this:
>> 
>> java.lang.NullPointerException: null
>> 	at org.apache.uima.ruta.rule.RutaLiteralMatcher.getAnnotation(RutaLiteralMatcher.java:72)
>> 	at org.apache.uima.ruta.rule.RutaLiteralMatcher.getMatchingAnnotations(RutaLiteralMatcher.java:62)
>> 	at org.apache.uima.ruta.rule.RutaLiteralMatcher.getMatchingAnnotations(RutaLiteralMatcher.java:37)
>> 	at org.apache.uima.ruta.rule.RutaRuleElement.getAnchors(RutaRuleElement.java:52)
>> 	at org.apache.uima.ruta.rule.RutaRuleElement.startMatch(RutaRuleElement.java:60)
>> 	at org.apache.uima.ruta.rule.ComposedRuleElement.startMatch(ComposedRuleElement.java:87)
>> 	at org.apache.uima.ruta.rule.ComposedRuleElement.startMatch(ComposedRuleElement.java:77)
>> 	at org.apache.uima.ruta.rule.RutaRule.apply(RutaRule.java:65)
>> 	at org.apache.uima.ruta.rule.RutaRule.apply(RutaRule.java:56)
>> 	at org.apache.uima.ruta.rule.RutaRule.apply(RutaRule.java:38)
>> 	at org.apache.uima.ruta.block.RutaScriptBlock.apply(RutaScriptBlock.java:72)
>> 	at org.apache.uima.ruta.RutaModule.apply(RutaModule.java:56)
>> 	at org.apache.uima.ruta.engine.RutaEngine.process(RutaEngine.java:612)
>> 	... 11 common frames omitted
>> 
>> So all I know is that something is null. But I have no idea what it could be. I cannot even reproduce the issue in the Eclipse Workbench: The XMI files that cause the error work without issue in Eclipse. The error only occurs when running the CPE with the Ruta component that I created using the Maven plugin.
>> Hence, I don’t even know what part of my script is causing the error. I have rules like this:
>> 
>> (WS|"("|"/") (Greek|NUM|Roman) {->MARK(Specifier)} (WS|"("|"/“);
>> 
>> which I think could be the cause. But this is based on the fact that I could fix the error with word lists until now. Hints and ideas on how to circumvent this issue are appreciated.
>> 
>> Best,
>> 
>> Erik


Re: RUTA: NPE in RutaLiteralMatcher

Posted by Peter Klügl <pk...@gmail.com>.
Hi Erik,


which version of Ruta do you use? It looks like you use an old version
in your maven dependencies, in which this bug hasn't been fixed yet.


Best,


Peter

Am 27.07.2021 um 12:06 schrieb Erik Fäßler:
> Hi everyone,
>
> I have been having an issue with literal matching for quite some time now. In the past, I just replaced all literal matching with word lists. In my current script, however, this would be rather cumbersome.
> The error looks like this:
>
> java.lang.NullPointerException: null
> 	at org.apache.uima.ruta.rule.RutaLiteralMatcher.getAnnotation(RutaLiteralMatcher.java:72)
> 	at org.apache.uima.ruta.rule.RutaLiteralMatcher.getMatchingAnnotations(RutaLiteralMatcher.java:62)
> 	at org.apache.uima.ruta.rule.RutaLiteralMatcher.getMatchingAnnotations(RutaLiteralMatcher.java:37)
> 	at org.apache.uima.ruta.rule.RutaRuleElement.getAnchors(RutaRuleElement.java:52)
> 	at org.apache.uima.ruta.rule.RutaRuleElement.startMatch(RutaRuleElement.java:60)
> 	at org.apache.uima.ruta.rule.ComposedRuleElement.startMatch(ComposedRuleElement.java:87)
> 	at org.apache.uima.ruta.rule.ComposedRuleElement.startMatch(ComposedRuleElement.java:77)
> 	at org.apache.uima.ruta.rule.RutaRule.apply(RutaRule.java:65)
> 	at org.apache.uima.ruta.rule.RutaRule.apply(RutaRule.java:56)
> 	at org.apache.uima.ruta.rule.RutaRule.apply(RutaRule.java:38)
> 	at org.apache.uima.ruta.block.RutaScriptBlock.apply(RutaScriptBlock.java:72)
> 	at org.apache.uima.ruta.RutaModule.apply(RutaModule.java:56)
> 	at org.apache.uima.ruta.engine.RutaEngine.process(RutaEngine.java:612)
> 	... 11 common frames omitted
>
> So all I know is that something is null. But I have no idea what it could be. I cannot even reproduce the issue in the Eclipse Workbench: The XMI files that cause the error work without issue in Eclipse. The error only occurs when running the CPE with the Ruta component that I created using the Maven plugin.
> Hence, I don’t even know what part of my script is causing the error. I have rules like this:
>
> (WS|"("|"/") (Greek|NUM|Roman) {->MARK(Specifier)} (WS|"("|"/“);
>
> which I think could be the cause. But this is based on the fact that I could fix the error with word lists until now. Hints and ideas on how to circumvent this issue are appreciated.
>
> Best,
>
> Erik