Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-7771

Classloader problem with "solr.XXX" class names and jars in SOLR_HOME/lib

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 5.2.1
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:

      C:\Users\elyograg\Downloads\solr-5.2.1>java -version
      java version "1.8.0_45"
      Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
      Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

      Description

      Jars placed in SOLR_HOME/lib seem to be loaded twice, which causes problems trying to use solr.XXXXXX class names in schema.xml.

      If the full class name is used, it works.

      Steps to recreate on an extracted Solr 5.2.1 download. This was done on Windows, so I used backslashes as path separators:

      bin\solr start
      bin\solr create -c foo -d sample_techproducts_configs
      bin\solr stop -all
      

      Add the following to server\foo\conf\schema.xml, just before the </schema> end tag:

          <fieldType name="icu_test" class="solr.TextField">
            <analyzer> 
              <tokenizer class="solr.ICUTokenizerFactory"/>
            </analyzer>
          </fieldType>
      

      Create a new directory – server\solr\lib.
      Copy icu4j-54.1.jar and lucene-analyzers-icu-5.2.1.jar from contrib\analysis-extras to server\solr\lib.

      bin\solr start
      

      Note an exception in the logging tab:
      java.lang.NoClassDefFoundError: org/apache/lucene/analysis/icu/segmentation/ICUTokenizer

      At this point, if the class name is changed from solr.ICUTokenizerFactory to org.apache.lucene.analysis.icu.segmentation.ICUTokenizerFactory and solr is stopped and started, then everything is OK.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                elyograg Shawn Heisey
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: