Reputation: 7934
I'm trying to setup a multi-core solr installation but cannot seem to get the configuration correct for solr to load the required classes.
The output on running java -jar start.jar
includes:
Sep 11, 2012 4:23:16 PM org.apache.solr.core.SolrResourceLoader replaceClassLoader
INFO: Adding 'file:/software/solr/solr/contrib/analysis-extras/lib/icu4j-4.8.1.1.jar' to classloader
Sep 11, 2012 4:23:16 PM org.apache.solr.core.SolrResourceLoader replaceClassLoader
INFO: Adding 'file:/software/solr/solr/contrib/analysis-extras/lucene-libs/lucene-icu-3.6.1.jar' to classloader
Sep 11, 2012 4:23:16 PM org.apache.solr.core.SolrResourceLoader replaceClassLoader
INFO: Adding 'file:/software/solr/solr/contrib/analysis-extras/lucene-libs/lucene-smartcn-3.6.1.jar' to classloader
Sep 11, 2012 4:23:16 PM org.apache.solr.core.SolrResourceLoader replaceClassLoader
INFO: Adding 'file:/software/solr/solr/contrib/analysis-extras/lucene-libs/lucene-stempel-3.6.1.jar' to classloader
Sep 11, 2012 4:23:16 PM org.apache.solr.core.SolrConfig <init>
WARNING: <indexDefaults> and <mainIndex> configuration sections are deprecated (but still work). Please use <indexConfig> instead.
Sep 11, 2012 4:23:16 PM org.apache.solr.core.SolrConfig <init>
INFO: Using Lucene MatchVersion: LUCENE_36
Sep 11, 2012 4:23:16 PM org.apache.solr.core.SolrConfig <init>
INFO: Loaded SolrConfig: solrconfig.xml
Sep 11, 2012 4:23:16 PM org.apache.solr.schema.IndexSchema readSchema
INFO: Reading Solr Schema
... snip ...
Sep 11, 2012 4:23:16 PM org.apache.solr.common.SolrException log
SEVERE: java.lang.NoClassDefFoundError: org/apache/lucene/analysis/icu/ICUFoldingFilter
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:388)
at org.apache.solr.core.SolrResourceLoader.newInstance(SolrResourceLoader.java:409)
at org.apache.solr.util.plugin.AbstractPluginLoader.create(AbstractPluginLoader.java:83)
org/apache/lucene/analysis/icu/ICUFoldingFactory
exists in lucene-icu-3.6.1.jar
so why is it not found later on?
My directory structure is:
|-solr
|---contrib
|-----analysis-extras
|-------lib
|-------lucene-libs
|-----velocity
|-------lib
|---cores
|-----core0
|-------conf
|-------data
|---------index
|-----core1
|-------conf
|-------data
|-----core2
|-------conf
|-------data
|---------index
|---lib
|-----solrj-lib
|-------optional
Upvotes: 3
Views: 3194
Reputation: 31
Another perhaps less labor intensive way to do this is to create a lib directory under whatever directory you are using for -Dsolr.solr.home (in your case, I'm guessing, that would be "cores"). I'm working with the example installation, and created lib under multicore and copied the analysis jars there. When I start up solr with java -Dsolr.solr.home=multicore -jar start.jar
I see the following in the log, and the cores I have defined start up without problems:
2471 [main] INFO org.apache.solr.core.SolrResourceLoader Adding 'file:/C:/Solr/solr-4.6.1/example/multicore/lib/icu4j-49.1.jar' to classloader
2471 [main] INFO org.apache.solr.core.SolrResourceLoader Adding 'file:/C:/Solr/solr-4.6.1/example/multicore/lib/lucene-analyzers-icu-4.6.1.jar' to classloader
2472 [main] INFO org.apache.solr.core.SolrResourceLoader Adding 'file:/C:/Solr/solr-4.6.1/example/multicore/lib/lucene-analyzers-morfologik-4.6.1.jar' to classloader
2472 [main] INFO org.apache.solr.core.SolrResourceLoader Adding 'file:/C:/Solr/solr-4.6.1/example/multicore/lib/lucene-analyzers-smartcn-4.6.1.jar' to classloader
2473 [main] INFO org.apache.solr.core.SolrResourceLoader Adding 'file:/C:/Solr/solr-4.6.1/example/multicore/lib/lucene-analyzers-stempel-4.6.1.jar' to classloader
2474 [main] INFO org.apache.solr.core.SolrResourceLoader Adding 'file:/C:/Solr/solr-4.6.1/example/multicore/lib/solr-analysis-extras-4.6.1.jar' to classloader
Upvotes: 0
Reputation: 7986
I found that I needed to put the following jars in each instance directory's lib:
apache-solr-analysis-extras-3.6.2.jar
lucene-icu-3.6.2.jar
lucene-stempel-3.6.2.jar
icu4j-4.8.1.1.jar
lucene-smartcn-3.6.2.jar
normalizer.jar
UnicodeNormalizeFilter.jar
My main problem was that I didn't realize that I needed apache-solr-analysis-extras-x.y.x.jar. That file is in apache-solr-3.6.2/dist. The next 4 are from apache-solr-3.6.2/contrib/analysis-extras. (I sort of think that normalizer.jar and UnicodeNormalizerFilter.jar are not need.)
Then in the schema.xml I needed to use:
<filter class="solr.ICUFoldingFilterFactory"/>
...not the org.apache.lucene.etc package name. I tried that org.apache.lucene.analysis package name and it didn't work. I found that sort of odd but it is how it looks in the documentation. http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters#solr.ICUTokenizerFactory
Upvotes: 4