Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-5708

the tag lib doesn't work in solrconfig.xml

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 4.6, 4.6.1
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:

      Linux, Ubuntu, but I believe this is not related.

      Description

      The lib option doesn't work and, hence, you cannot add put a solr extension jar in a specified library. As a workaround you can put the jar into <instance dir>/lib

      It doesn't work for at least two reasons:
      1) The instance dir is added twice: once in initLibs, and another time in addToClassLoader
      2) When I fixed this, I found out that the filtering class for addToClassLoader doesn't work properly.

      A rough fix is as follows, but it, probably, can't make use of Solr variables such as solr.solr.home. This is code changed in initLibs, I commented out incorrect lines:

              } else if (null != path) {
                //final File file = FileUtils.resolvePath(new File(loader.getInstanceDir()), path);
                final File file = new File(path);
                loader.addToClassLoader(file.getParent(), new FileFilter() {
                  @Override
                  public boolean accept(File pathname) {
                    //return pathname.equals(file);
                    return true;
                  }
                }, false);
      

        Activity

        Hide
        thetaphi Uwe Schindler added a comment -

        What do you mean with "tag lib"? Solr plugins work fine, if you put them in the lib folder.

        Show
        thetaphi Uwe Schindler added a comment - What do you mean with "tag lib"? Solr plugins work fine, if you put them in the lib folder.
        Hide
        searchivarius Leonid Boytsov added a comment -

        It is a documented option and there is a code to process it (I was debugging Solr):
        http://wiki.apache.org/solr/SolrConfigXml#lib

        Show
        searchivarius Leonid Boytsov added a comment - It is a documented option and there is a code to process it (I was debugging Solr): http://wiki.apache.org/solr/SolrConfigXml#lib
        Hide
        searchivarius Leonid Boytsov added a comment -

        I should have been more specific, sorry, I am talking about
        <lib path=

        Show
        searchivarius Leonid Boytsov added a comment - I should have been more specific, sorry, I am talking about <lib path=
        Hide
        searchivarius Leonid Boytsov added a comment -

        ... and the reason why the default location works is because the function is called with the hardwired string "lib", without instance name being appended. Hence, the instance name is CORRECTLY appended once:

        addToClassLoader("./lib/", null, true);

        Show
        searchivarius Leonid Boytsov added a comment - ... and the reason why the default location works is because the function is called with the hardwired string "lib", without instance name being appended. Hence, the instance name is CORRECTLY appended once: addToClassLoader("./lib/", null, true);

          People

          • Assignee:
            Unassigned
            Reporter:
            searchivarius Leonid Boytsov
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:

              Development