0
votes

I have done the below steps for Solr Integration to tomcat on windows machine.Can you please clarify what am I doing wrong here.

1) Download Solr and unzipped Solr 5.2.1 to the below directory C:\downloads\solr-5.2.1\solr-5.2.1.

2)Download Tomcat 7 zipped version and unzipped it to below location C:\downloads\apache-tomcat-7.0.62\apache-tomcat-7.0.62

3)Copy Jar files from C:\downloads\solr-5.2.1\solr-5.2.1\dist\solrj-lib directory to C:\downloads\apache-tomcat-7.0.62\apache-tomcat-7.0.62\lib directory.

4) Create a solr.xml in the C:\downloads\apache-tomcat-7.0.62\apache-tomcat-7.0.62\conf\Catalina\localhost folder.

<?xml version='1.0' encoding='UTF-8'?>
<context docBase="C:/downloads/apache-tomcat-7.0.62/apache-tomcat-7.0.62/webapps/solr.war" debug="0" crossContext="true" >
    <environment name="solr" type="java.lang.String" value="/apache-tomcat-7.0.62/webapps/" override="true"></environment>
</context>

5)Copy solr.war file from C:\downloads\solr-5.2.1\solr-5.2.1\server\webapps to C:\downloads\apache-tomcat-7.0.62\apache-tomcat-7.0.62\webapps folder.

6)Start the tomcat using startup.bat command in bin folder

7)Edit web.xml to

  <env-entry>
       <env-entry-name>solr/home</env-entry-name>
       <env-entry-value>C:/downloads/solr-5.2.1/solr-5.2.1</env-entry-value>
       <env-entry-type>java.lang.String</env-entry-type>
    </env-entry>

8)Restart the tomcat and hit the url http://localhost:8080/solr I get 404 Not found Error.The error in the console is

SEVERE: Error deploying configuration descriptor C:\downloads\apache-tomcat-7.0.
62\apache-tomcat-7.0.62\conf\Catalina\localhost\solr.xml
java.lang.NullPointerException
        at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.ja
va:645)
1

1 Answers

0
votes

The Solr wiki states that running 5.x versions on Tomcat is no longer supported:

Internally, Solr is still implemented via Servlet APIs and is powered by Jetty -- but this is simply an implementation detail. Deployment as a "webapp" to other Servlet Containers (or other instances of Jetty) is not supported, and may not work in future 5.x versions of Solr when additional changes are likely to be made to Solr internally to leverage custom networking stack features.