Error loading class 'solr.ICUCollationField' whilst setting up core

Created on 25 November 2018, over 6 years ago
Updated 27 January 2025, 4 months ago

Setting up SOLR locally on my macbook pro using homebrew. After I added the downloaded config files I get this error on http://127.0.0.1:8983/solr/#/d8

d8: org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: Could not load conf for core d8: Can't load schema /usr/local/opt/solr/server/solr/d8/conf/schema.xml: Plugin init failure for [schema.xml] fieldType "collated": Error loading class 'solr.ICUCollationField'

From googling it says I need to link some libraries but not really understanding. Discovered this issue which was recent that added this so wondering if it's just the install instructions haven't been updated - I've not done anything custom:

https://www.drupal.org/project/search_api_solr/issues/3009943 β†’

πŸ“Œ Task
Status

Fixed

Component

Documentation

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States mikegodin

    I was just encountering the ICUCollationField issue with Search API Solr 4.3.7 and Solr 9.8.0, and found the previous solutions did not work, but the following two solutions did work:

    1. Either add the following line to /etc/default/solr.in.sh:
    $SOLR_OPTS -Dsolr.sharedLib=/opt/solr/modules/analysis-extras/lib"

    2. Or copy the contents of:
    /opt/solr/modules/analysis-extras/lib
    to
    /opt/solr/server/solr-webapp/webapp/WEB-INF/lib

  • Hi, I have encountered the same issue with Search API Solr 4.3.7 and Solr 9.8.0. I found the following at the Logging page of Solr config;

    WARN false
    
    d8
    
    SolrConfig
    
    Configset references one or more <lib/> directives,&#8203; but <lib/> usage is disabled on this Solr node. Either remove all <lib/> tags from the relevant configset,&#8203; or <strong>enable use of this feature by setting 'solr.config.lib.enabled=true'</strong>
    

    I have taken another solution and it works.
    sudo vi /etc/default/solr.in.sh

    SOLR_OPTS="$SOLR_OPTS -Dsolr.config.lib.enabled=true"
    

    Major Changes in Solr 9.8: https://solr.apache.org/guide/solr/latest/upgrade-notes/major-changes-in-solr-9.html#solr-9-8

  • πŸ‡¨πŸ‡­Switzerland znerol

    For people running solr in containers: This can be fixed by supplying module configuration via the SOLR_MODULES environment variable.

    The following value loads all the modules referenced from solrconfig.xml currently shipped by Search API Solr module:

    SOLR_MODULES=extraction,langid,ltr,analysis-extras
    
  • πŸ‡ͺπŸ‡ΈSpain sblasco

    Hello!,

    As says znerol, if you edit your docker-compose.yml and you add this to the file, the issue will be fixed:

    solr:
    image: wodby/solr:$SOLR_TAG
    container_name: "${PROJECT_NAME}_solr"
    environment:
    SOLR_MODULES: extraction,langid,ltr,analysis-extra

    The important part is "SOLR_MODULES:"

    It will be neccesary restart the container

  • πŸ‡ͺπŸ‡ΈSpain sblasco

    Hello!,

    As says znerol, if you edit your docker-compose.yml and you add this to the file, the issue will be fixed:

    solr:
    image: wodby/solr:$SOLR_TAG
    container_name: "${PROJECT_NAME}_solr"
    environment:
    SOLR_MODULES: extraction,langid,ltr,analysis-extras

    The important part is "SOLR_MODULES:"

    It will be neccesary restart the container

  • πŸ‡΅πŸ‡±Poland michal_liszka

    I encountered the same issue with DDEV while upgrading Solr from version 8 to 9.

    To fix it, I had to add the following to docker-compose.solr.yaml:

    services:
        solr:
            build:
                args:
                   SOLR_BASE_IMAGE: ${SOLR_BASE_IMAGE:-solr:9}
              environment:
                  - SOLR_MODULES=extraction,langid,ltr,analysis-extras,scripting
    

    And in .ddev/solr/conf/solrconfig.xml, I had to update the XSLTResponseWriter class:

      - <queryResponseWriter name="xslt" class="solr.XSLTResponseWriter">
      + <queryResponseWriter name="xslt" class="solr.scripting.xslt.XSLTResponseWriter">
    

    After these changes, all communication started working correctly.

    Maybe it will help someone :)

Production build 0.71.5 2024