[
https://issues.apache.org/jira/browse/STANBOL-1342?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14005750#comment-14005750
]
Rupert Westenthaler commented on STANBOL-1342:
----------------------------------------------
(2) indicated that the wrong LabelTokenizer service was bound to the @Reference
defined in the EntityCoMention engine.
Most likely the static reference to the LabelTokenizer is not updated as a new
service with a higher ranking becomes available. If this is the case the
LabelTokenizer with the highest ranking at the time of the activation of the
EntityCoMention engine would be registered. If the MainLabelTokenizer would
only become available at a later point in time the EntityCoMention would not
use the LabelTokenizer with the highest ranking. This would explain the
observed behavior. This assumption is also confirmed by that fact that
stop/start on the component fixed the problem.
For solving (2) the EntityCoMention engine should use a ServiceTracker instead.
ServiceTracker#getService() is guaranteed to return the service with the
highest service.ranking.
> NPE in EntityCoMentionEngine if no LabelTokenizer is available for the
> language of the processed Text
> -----------------------------------------------------------------------------------------------------
>
> Key: STANBOL-1342
> URL: https://issues.apache.org/jira/browse/STANBOL-1342
> Project: Stanbol
> Issue Type: Bug
> Components: Enhancement Engines
> Affects Versions: 0.12.0
> Reporter: Rupert Westenthaler
> Assignee: Rupert Westenthaler
> Fix For: 1.0.0, 0.12.1
>
>
> The ContentItemMentionBuilder#registerTextAnnotation(..) currently runs into
> a NPE in case the parsed LabelTokenizer does not support the language of the
> in-memory entity index.
> This indicates two problems
> (1) the registerTextAnnotation(..) should not throw a NPE but instead check
> if the tokens are NULL
> (2) the fact that the LabelTokenizer indicates that the wrong service is
> injected to the EntityCoMentionEngine. Because the MainLabelTokenizer - that
> registers itself with a service.ranking=Intever.MAX_VALUE - would not return
> NULL
--
This message was sent by Atlassian JIRA
(v6.2#6252)