Ke.
Ke.

Reputation: 2586

solr example demo, cant work out where to put java folder

Ive followed this tutorial to install (multiple) solr instances on tomcat

http://wiki.apache.org/solr/SolrTomcat

Now i want to set up this demo but its not working

http://www.ibm.com/developerworks/java/library/j-solr1/

Ive built the dw.war as mentioned in the demo and now I get this error.

java.lang.NoClassDefFoundError: Could not initialize class org.apache.commons.httpclient.HttpClient
    org.apache.dwexample.servlet.DWServlet.sendGetCommand(DWServlet.java:714)
    org.apache.dwexample.servlet.DWServlet.processSubmitQuery(DWServlet.java:634)
    org.apache.dwexample.servlet.DWServlet.doGet(DWServlet.java:120)
    org.apache.dwexample.servlet.DWServlet.doPost(DWServlet.java:782)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

Thinking that it was an error in the /tomcat/lib directory copied the commons-httpclient-3.0.jar into the /tomcat/lib directory and did

chcon -R -h -t httpd_sys_content_t /usr/share/apache-tomcat-6.0.18/lib/

Now I get two errors:

java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
    org.apache.commons.httpclient.HttpClient.<clinit>(HttpClient.java:65)
    org.apache.dwexample.servlet.DWServlet.sendPostCommand(DWServlet.java:663)
    org.apache.dwexample.servlet.DWServlet.processSubmitCommand(DWServlet.java:596)
    org.apache.dwexample.servlet.DWServlet.processIndexCommand(DWServlet.java:557)
    org.apache.dwexample.servlet.DWServlet.processCommit(DWServlet.java:225)
    org.apache.dwexample.servlet.DWServlet.doGet(DWServlet.java:100)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

root cause

java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
    org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
    org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
    org.apache.commons.httpclient.HttpClient.<clinit>(HttpClient.java:65)
    org.apache.dwexample.servlet.DWServlet.sendPostCommand(DWServlet.java:663)
    org.apache.dwexample.servlet.DWServlet.processSubmitCommand(DWServlet.java:596)
    org.apache.dwexample.servlet.DWServlet.processIndexCommand(DWServlet.java:557)
    org.apache.dwexample.servlet.DWServlet.processCommit(DWServlet.java:225)
    org.apache.dwexample.servlet.DWServlet.doGet(DWServlet.java:100)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

Would love to find out how to solve these errors. cataling log output doesnt give much to go by.

Cheers

Ke

Upvotes: 0

Views: 2428

Answers (1)

instanceof me
instanceof me

Reputation: 39138

Your first fix is right, you just miss another library, which is Jakarta Commons Logging. Also get the JAR and put it with your libs. Note that there may be more dependencies afterwards, it just stops on the first error. Are you sure there is no "lib" folder in the package you downloaded with a bunch of JARs ?

Upvotes: 2

Related Questions