[
https://issues.apache.org/jira/browse/SOLR-7771?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14623460#comment-14623460
]
Shawn Heisey commented on SOLR-7771:
------------------------------------
Further testing after the steps already described, which describes another
workaround:
renamed server\solr\lib to server\solr\libXX so it no longer gets used.
changed the class name in schema.xml back to solr.ICUTokenizerFactory.
removed all <lib> elements from solrconfig.xml and replaced them with these
lines:
{noformat}
<lib dir="${solr.install.dir:../../../..}/contrib/analysis-extras/lib"
regex=".*\.jar" />
<lib
dir="${solr.install.dir:../../../..}/contrib/analysis-extras/lucene-libs"
regex=".*\.jar" />
{noformat}
When Solr was restarted, everything worked, and the jars only got loaded once,
because the install only has one core. I don't like this workaround, because
if I have three dozen cores that all have <lib> directives pointing at the same
jars, then those jars will be loaded three dozen times.
The "full class name" workaround is somewhat reasonable, and is likely the
direction that I will go in my own setup when I can finally upgrade to 5.x, but
if a novice user follows existing documentation, they won't be using full class
names.
> Classloader problem with "solr.XXX" class names and jars in SOLR_HOME/lib
> -------------------------------------------------------------------------
>
> Key: SOLR-7771
> URL: https://issues.apache.org/jira/browse/SOLR-7771
> Project: Solr
> Issue Type: Bug
> Affects Versions: 5.2.1
> 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)
> Reporter: Shawn Heisey
>
> 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:
> {noformat}
> bin\solr start
> bin\solr create -c foo -d sample_techproducts_configs
> bin\solr stop -all
> {noformat}
> Add the following to server\foo\conf\schema.xml, just before the </schema>
> end tag:
> {noformat}
> <fieldType name="icu_test" class="solr.TextField">
> <analyzer>
> <tokenizer class="solr.ICUTokenizerFactory"/>
> </analyzer>
> </fieldType>
> {noformat}
> 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.
> {noformat}
> bin\solr start
> {noformat}
> 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.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]