0

I'm trying to implement an Java program using EmbeddedSolrServer and when I run my program I get an exception :

Jul 03, 2013 12:13:49 PM org.apache.solr.core.CoreContainer <init>
INFO: New CoreContainer 2120829822
Jul 03, 2013 12:13:49 PM org.apache.solr.core.CoreContainer load
INFO: Loading CoreContainer using Solr Home: '/home/usersolr/solr-4.2.1/indexation_test1/solr'
Jul 03, 2013 12:13:49 PM org.apache.solr.core.SolrResourceLoader <init>
INFO: new SolrResourceLoader for directory: '/home/usersolr/solr-4.2.1/indexation_test1/solr/'
Exception in thread "main" java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: java.lang.NoClassDefFoundError: org/apache/lucene/codecs/PostingsFormat
    at org.apache.solr.core.SolrResourceLoader.reloadLuceneSPI(SolrResourceLoader.java:181)
    at org.apache.solr.core.SolrResourceLoader.<init>(SolrResourceLoader.java:114)
    at org.apache.solr.core.SolrResourceLoader.<init>(SolrResourceLoader.java:231)
    at org.apache.solr.core.CoreContainer.load(CoreContainer.java:422)
    at org.apache.solr.core.CoreContainer.load(CoreContainer.java:405)
    at org.apache.solr.core.CoreContainer.<init>(CoreContainer.java:189)
    at Main.Main.main(Main.java:35)
    ... 5 more
Caused by: java.lang.ClassNotFoundException: org.apache.lucene.codecs.PostingsFormat
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
    ... 12 more

Have someone already met this exception ? In witch JAR file can found the PostingsFormat class ?

Edit (Solved):

If you're like me and you don't know exactly where to find some jars you need, it's possible to find some jars files under these paths :

  • solr-X.X.X/example/solr-webapp/webapp/WEB-INF/lib/
  • solr-X.X.X/example/lib (particularly : servlet-api-X.X.jar)

Hope it helps !

Thank Marvin Emil Brach & Jayendra

Corentin

1
  • lucene-core-4.2.0.jar Commented Jul 3, 2013 at 11:20

1 Answer 1

1

Please check the lucene-core-X.X.X jar to the class.
Also, if you have download Solr you would have all the required lucene jars in the lib folder which you can check for any class not found exception.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks Jayendra, it works with this jar. I've got other exception but I'll find the solution thanks to your advice, I'll check the "lib" folder.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.