1

Using Drupal, we've tried to import the configuration files from the solr_api_search module. When importing them and trying to initialize the core, I see the following error (Solr 7.7.2):

Could not load conf for core testcore: Can't load schema /data/solr_data/data/testcore/conf/schema.xml: Plugin init failure for [schema.xml] fieldType \"collated_ar\": Error loading class 'solr.ICUCollationField'

This is what the inside of the solrcore.properties file looks like. I added the solr.install.dir option after some people with similar issues reported that it fixed their problem:

solr.replication.master=false
solr.replication.slave=false
solr.replication.pollInterval=00:00:60
solr.replication.masterUrl=http://localhost:8983/solr
solr.replication.confFiles=schema.xml,schema_extra_types.xml,schema_extra_fields.xml,elevate.xml,stopwords_ar.txt,synonyms_ar.txt,nouns_ar.txt,protwords_ar.txt,accents_ar.txt,stopwords_en.txt,synonyms_en.txt,protwords_en.txt,accents_en.txt,stopwords_fr.txt,synonyms_fr.txt,nouns_fr.txt,protwords_fr.txt,accents_fr.txt,stopwords_de.txt,synonyms_de.txt,nouns_de.txt,protwords_de.txt,accents_de.txt,stopwords_el.txt,synonyms_el.txt,nouns_el.txt,protwords_el.txt,accents_el.txt,stopwords_hi.txt,synonyms_hi.txt,nouns_hi.txt,protwords_hi.txt,accents_hi.txt,stopwords_it.txt,synonyms_it.txt,nouns_it.txt,protwords_it.txt,accents_it.txt,stopwords_und.txt,synonyms_und.txt,protwords_und.txt,accents_und.txt,stopwords_pl.txt,synonyms_pl.txt,nouns_pl.txt,protwords_pl.txt,accents_pl.txt,stopwords_pt-br.txt,synonyms_pt-br.txt,nouns_pt-br.txt,protwords_pt-br.txt,accents_pt-br.txt,stopwords_ru.txt,synonyms_ru.txt,nouns_ru.txt,protwords_ru.txt,accents_ru.txt,stopwords_es.txt,synonyms_es.txt,nouns_es.txt,protwords_es.txt,accents_es.txt,stopwords_tr.txt,synonyms_tr.txt,nouns_tr.txt,protwords_tr.txt,accents_tr.txt

solr.luceneMatchVersion=7.7
solr.install.dir=/opt/solr

This is the process running with ps -ef:

java -server -Xms512m -Xmx512m -XX:NewRatio=3 -XX:SurvivorRatio=4 -XX:TargetSurvivorRatio=90 -XX:MaxTenuringThreshold=8 -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:ConcGCThreads=4 -XX:ParallelGCThreads=4 -XX:+CMSScavengeBeforeRemark -XX:PretenureSizeThreshold=64m -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=50 -XX:CMSMaxAbortablePrecleanTime=6000 -XX:+CMSParallelRemarkEnabled -XX:+ParallelRefProcEnabled -verbose:gc -XX:+PrintHeapAtGC -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTime -Xloggc:/data/solr_data/logs/solr_gc.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=9 -XX:GCLogFileSize=20M -Dsolr.log.dir=/data/solr_data/logs -Djetty.port=8983 -DSTOP.PORT=7983 -DSTOP.KEY=solrrocks -Duser.timezone=UTC -Djetty.home=/opt/solr/server -Dsolr.solr.home=/data/solr_data/data -Dsolr.data.home= -Dsolr.install.dir=/opt/solr -Dsolr.default.confdir=/opt/solr/server/solr/configsets/_default/conf -Dlog4j.configurationFile=file:/data/solr_data/log4j.properties -Xss256k -Xss256k -Dsolr.jetty.https.port=8983 -Dsolr.log.muteconsole -XX:OnOutOfMemoryError=/opt/solr/bin/oom_solr.sh 8983 /data/solr_data/logs -jar start.jar --module=http

I have the following libraries inside of /opt/solr/contrib/analysis-extras/lib

-rw-r--r--. 1 solr solr 12370975 Jun 20  2018 icu4j-62.1.jar
-rw-r--r--. 1 solr solr    20140 Feb 18  2018 morfologik-fsa-2.1.5.jar
-rw-r--r--. 1 solr solr  1886867 Feb 18  2018 morfologik-polish-2.1.5.jar
-rw-r--r--. 1 solr solr    53644 Feb 18  2018 morfologik-stemming-2.1.5.jar
-rw-r--r--. 1 solr solr  1245779 Jun 29  2018 opennlp-tools-1.9.0.jar

Is there some option that I am missing in order to get Solr to load the .jar files?

J. Doe
  • 1,479
  • 5
  • 25
  • 49
  • 2
    Have you added the icu jar to the `lib` directives in `solrconfig.xml`? https://lucene.apache.org/solr/guide/6_6/lib-directives-in-solrconfig.html – MatsLindh Jun 30 '20 at 08:05
  • It looks like it is set to dir=`"${solr.install.dir:../../../..}/contrib/analysis-extras/lib" regex=".*\.jar" />`. Should I just make it `${solr.install.dir}/contrib/analysis-extras/lib` as the path instead? – J. Doe Jun 30 '20 at 08:13
  • Do you see the .jar file being loaded in the log when Solr is starting up? – MatsLindh Jun 30 '20 at 08:21
  • The only thing I see in the log directories are things detailing the time it took for the application threads to stop, along with the survivor sizes. I dont see anything listing what is being loaded – J. Doe Jun 30 '20 at 08:28
  • 1
    It'll only show on startup - you can use `solr start -f` to get the log directly in your terminal window with an INFO level pre-configured. Look for something like `Added 45 libs to classloader, from paths: [/.../solr-8.5.0/contrib/extraction/lib, /.../solr-8.5.0/dist]` – MatsLindh Jun 30 '20 at 08:50
  • That did it, thanks. I dont see any libs being loaded into the classloader on startup in the logs being generated (theres no line adding anything to classloader), which explains why it's failing. Do you have an idea why it isn't loading any of them? – J. Doe Jun 30 '20 at 09:04
  • These are usually created per core, since the solrconfig is core specific. Try to add a more specific (i.e. use the absolute path for testing) lib directive and see if you anything gets loaded. Try moving the libs to a different path and test if that works; restart Solr for each attempt to make sure it's being picked up. Run in non-cloud mode (in cloud mode the solrconfig-file will be located in zookeeper) for testing. – MatsLindh Jun 30 '20 at 09:08

1 Answers1

3

SOlr requires different features that require an optional libraries. All of these are comes with Solr. You need to adjust solr.install.dir like already mentioned in file named INSTALL.md

Updating path to solr.install.dir=/opt/solr in solrcore.properties to fix the issue.

Check the jar named as "icu4j-62.1.jar". Check the path of the same is mentioned in solrConfig.xml and check it the lib is getting loaded.

Abhijit Bashetti
  • 8,518
  • 7
  • 35
  • 47