[ 
https://issues.apache.org/jira/browse/SOLR-5278?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13779441#comment-13779441
 ] 

Hoss Man commented on SOLR-5278:
--------------------------------

bq. The problem is a "bug" in your JAR file which does not have the codecs 
listed in its metadata.

correct - but the bug doesn't manifest itself until long after the index has 
already been created with teh buggy codec - making it really hard to tell you 
have a problem in your codec jar.  Afterall: you start up your app, your codec 
is clearly getting used because you see the index being created and you can 
search it -- it's only later when you restart the app and it tires to open the 
files on disk that you have a problem.

I asked Scott to open this so we could look into having something/somewhere in 
solr/lucene fail fast if you tried to "write" segment(s) with a codec that 
wasn't going to be resolvable with SPI later when you tied to "read" those 
segments with the same classpath.

I have no strong opinion about wether this should be in IndexWriter, or 
somewhere in Solr when it's initializing the codec factory.
                
> 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]

Reply via email to