lucene-solr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ryan McKinley (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (SOLR-736) SolrCore.getSolrCore() may create a SolrCore without a CoreContainer
Date Wed, 08 Oct 2008 21:51:44 GMT

     [ https://issues.apache.org/jira/browse/SOLR-736?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Ryan McKinley resolved SOLR-736.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 1.4

thanks Henri!

> SolrCore.getSolrCore() may create a SolrCore without a CoreContainer
> --------------------------------------------------------------------
>
>                 Key: SOLR-736
>                 URL: https://issues.apache.org/jira/browse/SOLR-736
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 1.3
>            Reporter: Henri Biestro
>            Assignee: Ryan McKinley
>             Fix For: 1.4
>
>
> The method is deprecated but one can still initialize & start working this way.
> Potential fix could be:
> {code}
>   @Deprecated
>   public static SolrCore getSolrCore() {
>     synchronized( SolrCore.class ) {
>       if( instance == null ) {
>         try {
>           // sets 'instance' to the latest solr core
>           CoreContainer.Initializer init = new CoreContainer.Initializer();
>           instance = init.initialize().getCore("");
>         } catch(Exception xany) {
>           throw new SolrException( SolrException.ErrorCode.SERVER_ERROR,
>               "error creating core", xany );
>         }
>       }
>     }
>     return instance;
>   }
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message