1

I am currently working on upgrading multiple solr cores(3) from version 4.10 to 5.3.3 (and then to 6.2). I did a fresh install of solr 5.3.3, and then added my cores to the new installation.

We also use the libraries, icu4j , lucene-analyzers-icu , solr-analysis-extras, so I loaded them for version 5.3.3. One of the core works fine, as it does not have any custom field type defined. But, with the other two cores I am getting the below errors, Initially I received error

org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: Could not load conf for core product: Can't load schema /var/solr/data/cores/product/conf/schema.xml: Plugin init failure for [schema.xml] fieldType "text_sortable": Error loading class 'solr.ICUCollationField'

So, I removed the below line from schema.xml, and the above error disappaeared,

<fieldType name="text_sortable" class="solr.ICUCollationField" locale="" strength="primary"/>

But now I am receiving the below error,

org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: JVM Error creating core [suggest]: An SPI class of type org.apache.lucene.analysis.util.CharFilterFactory with classname org.apache.lucene.analysis.icu.ICUNormalizer2CharFilterFactory does not exist, please fix the file 'META-INF/services/org.apache.lucene.analysis.util.CharFilterFactory' in your classpath.

I am not sure how to proceed from here, Any suggestions on how to fix the above error will be helpful

tux
  • 1,730
  • 1
  • 15
  • 19
  • Both classes are still available in Solr, so be sure that you're actually loading the `ICU4J` library. The log might be able to show you the libraries as they're being loaded? – MatsLindh Sep 11 '16 at 20:36
  • @MatsLindh , The libs are being loaded during startup, the startup log as follow, 1712 INFO (coreLoadExecutor-6-thread-3) [ ] o.a.s.c.SolrConfig Adding specified lib dirs to ClassLoader 1713 INFO (coreLoadExecutor-6-thread-3) [ ] o.a.s.c.SolrResourceLoader Adding 'file:/opt/shared_libs/lucene-analyzers-icu-5.5.3-sources.jar' to classloader 1713 INFO (coreLoadExecutor-6-thread-3) [ ] o.a.s.c.SolrResourceLoader Adding 'file:/opt/shared_libs/icu4j-54.1.1-sources.jar' to classloader – tux Sep 12 '16 at 04:47
  • But do you want to load the `sources` .jar and not the binary jar (`icu4j-54_1_1.jar`)? – MatsLindh Sep 12 '16 at 09:32
  • 1
    @MatsLindh Thank you very much for pointing that out, after loading the binaries, everything worked like a charm. I should have not loaded the sources. – tux Sep 12 '16 at 13:45

1 Answers1

1

For anyone coming across this in the future: the ICU fields require the icu4j library to be loaded. You can check the Solr log to see which libraries are actually being loaded by Solr when it's starting up.

According to your log you're loading the wrong set of jars in your classloader. The correct jar for ICU is the one without any extra naming, such as sources, etc. The current version is named icu4j-54_1_1.jar.

MatsLindh
  • 49,529
  • 4
  • 53
  • 84