Solr
  1. Solr
  2. SOLR-736

SolrCore.getSolrCore() may create a SolrCore without a CoreContainer

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.3
    • Fix Version/s: 1.4
    • Component/s: None
    • Labels:
      None

      Description

      The method is deprecated but one can still initialize & start working this way.
      Potential fix could be:

        @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;
        }
      

        Issue Links

          Activity

          No work has yet been logged on this issue.

            People

            • Assignee:
              Ryan McKinley
              Reporter:
              Henri Biestro
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development