[
https://issues.apache.org/jira/browse/STANBOL-778?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Fabian Christ updated STANBOL-778:
----------------------------------
Fix Version/s: parent-2
> RegisteredSolrServerTracker should track for all services
> ---------------------------------------------------------
>
> Key: STANBOL-778
> URL: https://issues.apache.org/jira/browse/STANBOL-778
> Project: Stanbol
> Issue Type: Sub-task
> Components: Build, Parent
> Reporter: Rupert Westenthaler
> Assignee: Rupert Westenthaler
> Priority: Minor
> Fix For: parent-2
>
>
> Running Stanbol within an embedded OSGI environment caused the
> RegisteredSolrServerTracker (subclass of ServiceTracker) to not return
> expected Services because the OSGI framework believed that the tracked class
> (solr.core.CoreContainer or solr.core.SolrCore) are NOT wired to the same
> service type.
> This only happened to services that where already present (active) at the
> time open() is called to the ServiceTracker. Subsequentls processed Event
> from the ServiceListener are correctly processed.
> The BundleContext used to register those services is the one of
> o.a.s.commons.solr.core. The BundleContext used for the ServiceTracker is the
> one of "o.a.s.entityhub.yard.solr".
> One reason for that could be that while the RegisteredSolrServerTracker does
> track solr.core.CoreContainer or solr.core.SolrCore it actually returns
> instances of solr.client.solrj.SolrServer. because of that users of this
> tracker do not directly import the Interfaces used for tracking. However this
> assumption can not really explain why subsequent ServiceListener events are
> processed correctly.
> While the exact reason for the reported behavior is not yet fully understood
> a fix for this problem can be implemented as follows:
> 1) use ServiceTracker.open(true) as default (by overwriting open() in
> RegisteredSolrServerTracker and calling open(true)
> 2) implement the addingService(ServiceReference reference) method so that it
> does make a instanceof check for the parsed service object. If this check
> fails the method need to return NULL - telling the tracker, that the parsed
> ServiceReference needs not be tracked
> 3) print an according WARN level log that helps to further investigate this.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira