Uploaded image for project: 'Stanbol (Retired)'
  1. Stanbol (Retired)
  2. STANBOL-1045

SolrCommons need to override the ContextClassLoader when loading Solr Analyzers

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • commons-0.11.0
    • 0.12.0
    • Commons
    • None

    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

          Activity

            People

              rwesten Rupert Westenthaler
              rwesten Rupert Westenthaler
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: