Description
With Solr it is necessary to reset the ContextClassLoader to the Bundle ClassLoader when initializing Analyzers. This is because Solr also considers the ContextClassLoader for loading those classes and if Stanbol does run within an embedded OSGI environment this might result in Solr versions used by the host application to leak into OSGI. This usually results in ClassCastExceptions.
While the SolrServerAdapter (commons.solr.core) has done this already with the upgrade to Solr 4 this is now also necessary for the BundleActivators used by all commons.solr.extra modules. Otherwise those would find "META-INF/services/
{solr-component}.properties" files via the ContextClassLoader pointing to class files of the host application. While loading the classes would work the cast to the according interface would end with an ClassCastException as the interface is loaded via the Bundle ClassLoader.
Attachments
Issue Links
- relates to
-
STANBOL-1012 Register Solr AnlyzerFactories as OSGI services and provide OSGI enabled SolrResourceLoader
- Resolved