[
https://issues.apache.org/jira/browse/SOLR-5278?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13779428#comment-13779428
]
Uwe Schindler commented on SOLR-5278:
-------------------------------------
But in any case, this would also a good additional check for IndexWriter, so
maybe do this in IndexWriter instead of Solr: The custom codec passed in the
IndexWriterConfig should be checked, if it can be found by name using SPI. If
not, throw Exception. By this we can check early that a codec cannot work and
don't let the user crash when he opens an IndexWriter for the first time. The
issue with Solr is the use of NRT readers, which know the codec from
IndexWriter.
> Can create an index with a custom codec, but not load it
> --------------------------------------------------------
>
> Key: SOLR-5278
> URL: https://issues.apache.org/jira/browse/SOLR-5278
> Project: Solr
> Issue Type: Bug
> Components: SolrCloud
> Affects Versions: 4.0, 4.4
> Reporter: Scott Schneider
> Priority: Minor
>
> This really is a case where Solr could display a helpful error message about
> incomplete configuration of a custom codec.
> I created a custom codec and set it in the codecFactory directive in
> solrconfig.xml, but didn't create an org.apache.lucene.codecs.Codec file.
> When I ran Solr for the first time, it works fine: I can post new data and
> query. Also, if I stop Solr, delete the data directory, and start Solr
> again, it works fine. But when I stop Solr and start again, I get this error:
> 2380 [coreLoadExecutor-3-thread-1] ERROR org.apache.solr.core.CoreContainer
> รป Unable to create core: collection1
> org.apache.solr.common.SolrException: Error opening new searcher
> ...
> Caused by: org.apache.solr.common.SolrException: Error opening new searcher
> ...
> Caused by: org.apache.solr.common.SolrException: Error opening Reader
> ...
> Caused by: java.lang.IllegalArgumentException: A SPI class of type
> org.apache.lucene.codecs.Codec with name 'EncryptedStoredFieldsCodec' does
> not exist. You need to add the corresponding JAR file supporting this SPI to
> your classpath. The current classpath supports the following names:
> [SimpleText, Appending, Lucene40, Lucene3x, Lucene41, Lucene42]
> at
> org.apache.lucene.util.NamedSPILoader.lookup(NamedSPILoader.java:109)
> ...
> My JAR is definitely in the classpath. It has my .class files, but no
> org.apache.lucene.codecs.Codec file. I believe this error condition will be
> easy to repro, but contact me if it's not.
> Chris Hostetter asked me to file this. His suggested fix is that, when Solr
> uses the configured codec factory, it should test whether SPI can find the
> corresponding custom codec. If not, it should throw an exception with a
> clear error message.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]