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

Tommaso Teofili commented on SOLR-2983:
---------------------------------------

it looks like it's a cyclic dependency problem since the SolrIndexWriter uses 
the SolrIndexConfig.toIndexWriterConfig method to create an IndexWriterConfig 
which is used to call the basic Lucene IndexWriter constructor while at the 
same time the SolrIndexConfig.toIndexWriterConfig may need an IndexWriter to 
instantiate the MergePolicy (try clause).
                
> Unable to load custom MergePolicy
> ---------------------------------
>
>                 Key: SOLR-2983
>                 URL: https://issues.apache.org/jira/browse/SOLR-2983
>             Project: Solr
>          Issue Type: Bug
>            Reporter: Mathias Herberts
>            Priority: Critical
>             Fix For: 3.6, 4.0
>
>
> As part of a recent upgrade to Solr 3.5.0 we encountered an error related to 
> our use of LinkedIn's ZoieMergePolicy.
> It seems the code that loads a custom MergePolicy was at some point moved 
> into SolrIndexConfig.java from SolrIndexWriter.java, but as this code was 
> copied verbatim it now contains a bug:
>     try {
>       policy = (MergePolicy) 
> schema.getResourceLoader().newInstance(mpClassName, null, new 
> Class[]{IndexWriter.class}, new Object[]{this});
>     } catch (Exception e) {
>       policy = (MergePolicy) 
> schema.getResourceLoader().newInstance(mpClassName);
>     }
> 'this' is no longer an IndexWriter but a SolrIndexConfig, therefore the call 
> to newInstance will always throw an exception and the catch clause will be 
> executed. If the custom MergePolicy does not have a default constructor 
> (which is the case of ZoieMergePolicy), the second attempt to create the 
> MergePolicy will also fail and Solr won't start.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to