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

java.lang.NoClassDefFoundError: org/apache/lucene/search/Searcher

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 4.10.2
    • None
    • None

    Description

      Hello,

      I'm trying to implement a Solrj solution using both Solr and Lucene version 4.10.2. The simple code:
      <code>
      CoreContainer.Initializer initializer = new CoreContainer.Initializer();
      CoreContainer coreContainer = null;
      try

      { coreContainer = initializer.initialize(); }

      catch (IOException | ParserConfigurationException | SAXException e)

      { System.out.println("Error with Solr initialization"); e.printStackTrace(); }

      </code>

      produces next error:

      Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/lucene/search/Searcher
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
      at java.net.URLClassLoader.defineClass(URLClassLoader.java:455)
      at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:367)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      at org.apache.solr.core.SolrConfig.<init>(SolrConfig.java:132)
      at org.apache.solr.core.SolrConfig.<init>(SolrConfig.java:70)
      at org.apache.solr.core.CoreContainer$Initializer.initialize(CoreContainer.java:117)
      at com.company.SolrRAndD.doEveryThing(SolrRAndD.java:58)

      The lucene-core-4.10.2.jar is in classpath. Could you help me with that?

      Thanks in advance.

      Attachments

        Activity

          People

            Unassigned Unassigned
            podolsky Sergey Podolsky
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: