Apache Solr would not start. Keeps throwing the following error

    java -jar example/start.jar 


    java.lang.ClassNotFoundException: org.mortbay.xml.XmlConfiguration
            at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
            at org.mortbay.start.Main.invokeMain(Main.java:179)
            at org.mortbay.start.Main.start(Main.java:534)
            at org.mortbay.start.Main.start(Main.java:441)
            at org.mortbay.start.Main.main(Main.java:119)
link|improve this question
feedback

3 Answers

Specify the classpath to solr files with -cp

java -cp <path> -jar example/start.jar 
link|improve this answer
For me it also worked when I did cd /path/to/example and then invoked solr. – Nifle May 26 '11 at 6:41
This hasn't worked for me. Probably because when the -jar option is used, the -cp option is ignored. Quote from the Java manual for the -jar option: "When you use this option, the JAR file is the source of all user classes, and other user class path settings are ignored." – chiborg Jan 10 at 10:53
Yes. This is true, You should add the dependencies on your jar Manifest. – Sacx Jan 12 at 7:46
feedback

When you're not inside the example dir, you need to specify the path for jetty.home. It may also be a good idea to set the jetty.logs option as well:

java -Djetty.home=example -Djetty.logs=/tmp -Dsolr.solr.home=example/solr -jar example/start.jar 
link|improve this answer
feedback

Make sure that you've met the requirements: http://wiki.apache.org/solr/SolrInstall

type: cd /opt/apache-solr-1.3.0/example type: java -jar start.jar http://wiki.apache.org/solr/SolrOnAmazonEC2

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.