Installing Lucene/Solr on CentOS 6

This time we are going to install Solr, the super text search platform on CentOS. The installation process requires a couple extra libraries in order to work: Apache Commons Logging and SLF4J.  

Installing Java

yum install java
java -version

You must have at least version 1.6 in order to run Solr. If you got Java 1.5, I recommend you to follow this tutorial to get version 1.6.

Installing Tomcat

yum -y install tomcat6 tomcat6-webapps tomcat6-admin-webapps
chkconfig tomcat6 on
service tomcat6 start 

Use a web browser to check it is working correctly.

http://localhost:8080/ 

If you cannot connect, check your firewall rules

iptables -vnL --line-numbers 

and make the necessary changes (Check these iptables snippets).

Ok, let’s go on. Add the following lines between the <tomcat-users> tag in /etc/tomcat6/tomcat-users.xml to add a manager role to your server:

<role rolename="manager" />
<role rolename="admin" />
<user username="AUserName" password="ASuperSecretPassword" roles="manager,admin" />

Important: Make sure to change the previous username and password!

Restart Tomcat

service tomcat6 restart   

Installing Apache Commons Loggins Download Apache Commons Logging from

http://commons.apache.org/proper/commons-logging/download_logging.cgi to your home directory.

Untar your file and copy the required files to your tomcat library folder:

cd
tar zxf commons-logging-1.1.3.tar.gz
cd commons-loggins-1.1.3
cp commons-logging-*.jar /usr/share/tomcat6/lib   

Installing SLF4J Download the latest version from

http://www.slf4j.org/ to your home directory. Untar your file and copy the required files to your tomcat library folder:

cd
tar zxf slf4j-1.7.5.tar.gz
cd slf4j-1.7.5
cp slf4j-*.jar /usr/share/tomcat6/lib

Update: Latest versions include a couple Android files (slf4j-android-1.7.7.jar and slf4j-android-1.7.7-sources.jar). Do not copy them. They will be read by tomcat preventing Solr to start.  

Installing Solr (Finally!) Download Solr from the Apache website to your home directory:

http://lucene.apache.org/solr/downloads.html 

Uncompress it:

cd
tar zxf ~/solr-4.5.1.tar.gz 

Copy (and rename) the included Solr war file (solr.war) to your Tomcat apps folder:

cp ~/solr-4.5.1/dist/solr-4.5.1.war /usr/share/tomcat6/webapps/solr.war 

Now it’s time to create the folder that will keep your Solr index and documents. We also have to copy a basic Solr structure into it. Fortunately, Solr comes with a predefined structure and includes preconfigured files in it. You have to make sure that there is plenty of space wherever you place this folder, since it can grow a lot. By the way, you can place this folder out of your Tomcat webapps folder. In my case, I have decided to put it in /home/solr. So, let’s do it:

mkdir /home/solr
cp -R ~/solr-4.5.1/example/solr/* /home/solr
chown -R tomcat /home/solr 

Restart Tomcat.

service tomcat6 restart

Solr is not ready yet, however this last time we restarted Tomcat it unpackaged the solr.war file. We need to edit a file inside that unpackaged directory structure. Edit your Solr web.xml file to let it know where your solar directory is located:

nano /usr/share/tomcat6/webapps/solr/WEB-INF/web.xml 

Look for the following code and edit it (don’t forget to remove the comment markers!):

<env-entry>
    <env-entry-name>solr/home</env-entry-name>
    <env-entry-value>/home/solr</env-entry-value>
    <env-entry-type>java.lang.String</env-entry-type>
</env-entry> 

Ok… so, restart Tomcat

service tomcat6 restart 

On your web browser go to:

http://localhost:8080/solr 

If everything is ok, your Solr instance should be ready to go.

solr-admin  

Troubleshooting

I recommend you to completely stop and start Tomcat over and over and take a look at:

tail /var/log/tomcat6/catalina.out 

If you do not restart Tomcat each time, errors will not be logged to the catalina.out file.  

65 Replies to “Installing Lucene/Solr on CentOS 6”

  1. Andres,

    After trawling that “internet” and seeing how many pages are out there with [incomplete|misleading|simply wrong] instructions for setting up solr with Tomcat, your page stood out as a clear and simple set of instructions… that actually work.

    1. +1 – I’ve spent the last 2 days trying to get SOLR to work in CENTOS with tomcat and after trying numerous ways (at least 5 different methods and scripts, versions…) This is the first tutorial that I was able to follow and get it working the first time!

      Thank you very much andres!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

        1. I just checked and the logging is saying” Can’t find (or read) directory to add to classloader: ../../../contrib/extraction/lib (resolved as: /home/solr/collection1/../../../contrib/extraction/lib).

          Do you have any suggestions?

          Thanks again!

          SR

  2. Hi there,

    I followed instructions to the letter, and got this error:
    “SolrCore ‘collection1’ is not available due to init failure: Could not load config file /solr/collection1/solrconfig.xml”

    I appears that it’s looking for solrconfig.xml in the wrong place. It actually lives in /solr/collection1/conf/solrconfig.xml

    Perhaps something changed with newer versions?

    Here is my web.xml entry. Does it have to be edited differently somehow?

    solr/home
    /solr
    java.lang.String

    Thanks for the awesome tutorial.
    Andrey.

    1. Update. Got it to work. Two things:
      1. Use /home/solr as the path.
      2. Disable clustering, as that is now default (4.5): in /home/solr/collection1/conf/solrconfig.xml, search for “clustering.enabled:true”, and change to “clustering.enabled:false”.

        1. Hi Paul,

          You have to do it here: /usr/share/tomcat6/webapps/solr/WEB-INF/web.xml
          Remember to restart Tomcat before, so it expands the solr.war file and you have access to such file.

          Best

    2. I had the same error message, but I made a much more trivial mistake.

      Even thought Andres made a point to make it bold, I still didn’t remove the comment markers in my web.xml file. Arrrrrghhh. That’ll teach me to read more closely.

  3. HI Andres,
    I followed your post and installed solr its working fine. I need to configure data source for that i config the solrconfig.xml file. How i can config that file ??? What i did means i added this into the solrconfig file under collection1

    /home/username/data-config.xml

    Is that correct ???

    and configured datasource config as

    am getting core not found error… Really a new one to solr. Please help to create that datasoure please give to instruction to do that

    Regards,
    Kiran

    1. Hi Kiran,

      There are two main files that you should change in order to have a custom repository: solrconfig.xml and schema.xml. Be sure to assign appropriate permissions to both files, this means, make sure that the Tomcat user (usually “tomcat”) can read both files.

      Those files are located in /home/solr/collection1/conf (if you installed Solr in the same directory where I did).

      You can start with a basic solrconfig.xml file like the following:

      <?xml version="1.0" encoding="utf-8" ?>
      
      <config>
        <luceneMatchVersion>4.4</luceneMatchVersion>
      
        <requestHandler name="/search" class="solr.SearchHandler" default="true" />
      
        <requestHandler name="/update" class="solr.UpdateRequestHandler" />
      
        <!-- Admin Handlers -->
        <requestHandler name="/admin/" class="solr.admin.AdminHandlers" />
      
        <!-- ping/healthcheck -->
        <requestHandler name="/admin/ping" class="solr.PingRequestHandler">
          <lst name="invariants">
            <str name="q">solrpingquery</str>
          </lst>
          <lst name="defaults">
            <str name="echoParams">all</str>
          </lst>
        </requestHandler>
      
      </config>
      

      schema.xml is the file where you actually define your database structure. This is, that is the file where you will specify what database fields you have. You can start by studying the included schema.xml file. I can help you by writing a post explaining the file structure.

      Hope you find it useful.

  4. Great Tutorial Thank you! I installed everything and worked fine until launching the Solr. I got a strange ERRORMSG that the root path could not be found. The problem was that sometines Centos installs Java 1.5 by default. For the latest Solr we need Java 1.6. Be aware and make sure you are installing the Java 1.6. If you get the 1.5 a simple update tutorials are avaliable on the net. After that just restart tomcat service and it should work …
    Cheers,
    Ivo

  5. Ok, so this is what i get in catalina.out:
    [root@phatty opt]# grep -i error /var/log/tomcat6/catalina.out
    SEVERE: Error processing TLD files for context path /host-manager
    SEVERE: Error processing TLD files for context path /manager
    SEVERE: Error processing TLD files for context path /solr
    760 [main] ERROR org.apache.solr.servlet.SolrDispatchFilter - Could not start Solr. Check solr/home property and the logs
    892 [main] ERROR org.apache.solr.core.SolrCore - null:java.lang.NoSuchMethodError: method java.lang.String.getBytes with signature (Ljava.nio.charset.Charset;)[B was not found.
    SEVERE: Error processing TLD files for context path /examples
    WARNING: Error unregistering MBeanServerDelegate
    WARNING: Error unregistering MBeanServerDelegate
    SEVERE: Error processing TLD files for context path /host-manager
    SEVERE: Error processing TLD files for context path /manager
    SEVERE: Error processing TLD files for context path /solr
    794 [main] ERROR org.apache.solr.servlet.SolrDispatchFilter - Could not start Solr. Check solr/home property and the logs
    928 [main] ERROR org.apache.solr.core.SolrCore - null:org.apache.solr.common.SolrException: Could not load SOLR configuration
    SEVERE: Error processing TLD files for context path /examples

    The only thing i did not like in this how to, i’ve changed solr’s home directory to /opt/solr. Anyway, it’s still owned by tomcat user and the /usr/share/tomcat6/webapps/solr/WEB-INF/web.xml is defined correctly. Any clues? 🙁

    1. Hi Andy,

      There is a line asking you to check the solr/home property. What’s the value for that property? Did you remove the comment markers?

      By the way, I recommend you to get this list using “tail” instead of “grep”; many messages may be left out.

      Best

    2. I had this same error on a Red Hat Enterprise 6.5 server and it was due to having Java 1.5.0 and Solr needing at least Java 1.6.0.

      I installed the latest Java alongside the existing version as I couldn’t “yum remove java” first as it would also remove tomcat since it was one of it’s dependencies.

      After “yum install java-1.7.0-openjdk” I had to edit the tomcat service config /etc/sysconfig/tomcat6 – I uncommented the JAVA_HOME=”…” line and changed it to the path for the new Java (/usr/lib/jvm/jre-1.7.0-openjdk.x86_64) in my case.

  6. Ok, it seems there might be a problem with my solr.xml file. This is what i’ve found in catalina.out log:
    0 [main] INFO org.apache.solr.servlet.SolrDispatchFilter - SolrDispatchFilter.init()
    29 [main] INFO org.apache.solr.core.SolrResourceLoader - Using JNDI solr.home: /opt/solr
    31 [main] INFO org.apache.solr.core.SolrResourceLoader - new SolrResourceLoader for directory: '/opt/solr/'
    728 [main] INFO org.apache.solr.core.ConfigSolr - Loading container configuration from /opt/solr/solr.xml
    859 [main] ERROR org.apache.solr.servlet.SolrDispatchFilter - Could not start Solr. Check solr/home property and the logs
    997 [main] ERROR org.apache.solr.core.SolrCore - null:org.apache.solr.common.SolrException: Could not load SOLR configuration

    Since i don’t use jetty and use tomcat, i presume this could be a problem. This is how my solr.conf looks: http://www.codepaste.eu/?hash=74d7803ba105c47a8138b1f88ca820f5

    Could anyone give me the example of correct solr.xml file?

  7. Ok, i finally got it working. So what did i do: i deinstalled java-1.7.0-openjdk and installed java-1.6.0-sun instead. I had to enable rhel-x86_64-server-supplementary-6, this is where i found java-1.6.0-sun package.
    Anyways, this how to is pretty good and clear, but if you’re using RHEL 6 rather than CentOS, keep in mind, that java stuff works better with sun package.

  8. why you are wasting time. dont do this
    only go download solr-4.6.0.tar.gz and extract it on same place where your tomcal is and go inside solr-4.6.0/example and run command: java -jar start.jar it’ll automatical start.
    see in browser http://localhost:8983/solr/

      1. yes i do all things and the log is


        Jun 28, 2014 7:28:23 AM org.apache.catalina.startup.Catalina start
        INFO: Server startup in 1082 ms
        Jun 28, 2014 7:28:26 AM org.apache.catalina.core.StandardContext start
        SEVERE: Error filterStart
        Jun 28, 2014 7:28:26 AM org.apache.catalina.core.StandardContext start
        SEVERE: Context [/solr] startup failed due to previous errors
        Jun 28, 2014 7:28:31 AM org.apache.catalina.core.StandardContext start
        SEVERE: Error filterStart
        Jun 28, 2014 7:28:31 AM org.apache.catalina.core.StandardContext start
        SEVERE: Context [/solr] startup failed due to previous errors

        1. Hello Ahmad,

          I was receiving the same errors but I noticed in the localhost file in the /var/log/tomcat6/ folder that “Unsupported major.minor version 51.0” was being mentioned after restarting tomcat6. version 51 refers to Java 7, looking at the requirements for the latest version of Solr, Java version 7 as a minimum is required.

          If you follow the tutorial to get rid of version 5, only adapted for version 6, the same commands work. To install Java 7 once you have removed the existing version of Java use this command:

          yum install java-1.7.0-openjdk

          Then restart tomcat6.

          This resolved my problem, hopefully it is the same issue you are facing.

          1. Yes, this solved my problem as well. If you follow this guide to install Lucene/Solr, you need to install Java 1.7 first … Java 1.5 and Java 1.6 will not work.

  9. hi,

    can you please tell how to make solr page authentication with nginx , i m going with port 8983 but how to make it password protected.. like we do as .htaccess in httpd server

  10. hi there andres, after i rebooted my machine tomcat starts normally but i cannot access solr!!!

    why i cannot acess?? the only page that appears is tomcat default page when i go 8080/solr/#

    the page gives me a timemout message

  11. Hi , Andres:

    After installed Solr, how can i setup Solr to index my files, such like word ,PDF ?

    Please help me.

    Thank you very much.

  12. Hi Andres –
    Great post! Love the way it’s been put together and has been very helpful with installing Solr. I did come across a hurdle though, once everything was set – ran into an issue. Solr wan’t come up and http://localhost:8080/solr gives the following error:

    message {msg=SolrCore ‘collection1’ is not available due to init failure: Error opening new searcher,trace=org.apache.solr.common.SolrException: SolrCore ‘collection1’ is not available due to init failure: Error opening new searcher at org.apache.solr.core.CoreContainer.getCore(CoreContainer.java:745) at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:307) at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:207) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:620) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:745) Caused by: org.apache.solr.common.SolrException: Error opening new searcher at org.apache.solr.core.SolrCore.(SolrCore.java:881) at org.apache.solr.core.SolrCore.(SolrCore.java:654) at org.apache.solr.core.CoreContainer.create(CoreContainer.java:491) at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:255) at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:249) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) … 1 more Caused by: org.apache.solr.common.SolrException: Error opening new searcher at org.apache.solr.core.SolrCore.openNewSearcher(SolrCore.java:1574) at org.apache.solr.core.SolrCore.getSearcher(SolrCore.java:1686) at org.apache.solr.core.SolrCore.(SolrCore.java:853) … 8 more Caused by: org.apache.lucene.index.IndexNotFoundException: no segments* file found in NRTCachingDirectory(MMapDirectory@/home/solr/collection1/data/index lockFactory=NativeFSLockFactory@/home/solr/collection1/data/index; maxCacheMB=48.0 maxMergeSizeMB=4.0): files: [write.lock] at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:864) at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:752) at org.apache.lucene.index.SegmentInfos.read(SegmentInfos.java:450) at org.apache.lucene.index.IndexWriter.(IndexWriter.java:792) at org.apache.solr.update.SolrIndexWriter.(SolrIndexWriter.java:77) at org.apache.solr.update.SolrIndexWriter.create(SolrIndexWriter.java:64) at org.apache.solr.update.DefaultSolrCoreState.createMainIndexWriter(DefaultSolrCoreState.java:279) at org.apache.solr.update.DefaultSolrCoreState.getIndexWriter(DefaultSolrCoreState.java:111) at org.apache.solr.core.SolrCore.openNewSearcher(SolrCore.java:1537) … 10 more ,code=500}

    Went through some of the comments above, and clustering is already set to false on 4.10 (what i’ve used here). Also set proper permissions to /home/solr/collection1 folder – with no luck.

    Appreciate your help in advance.

  13. I have following error.: Kindly check and update what is the issue?.

    HTTP Status 404 –
    type Status report
    message
    description The requested resource () is not available.
    Apache Tomcat/6.0.24

    My Log File: /var/log/tomcat6/catalina.out

    Apr 10, 2015 5:02:33 AM org.apache.coyote.http11.Http11Protocol pause
    INFO: Pausing Coyote HTTP/1.1 on http-8080
    Apr 10, 2015 5:02:33 AM org.apache.catalina.connector.Connector pause
    SEVERE: Protocol handler pause failed
    java.net.UnknownHostException: ip-172-30-0-186: ip-172-30-0-186: Name or service not known
    at java.net.InetAddress.getLocalHost(InetAddress.java:1473)
    at org.apache.jk.common.ChannelSocket.unLockSocket(ChannelSocket.java:485)
    at org.apache.jk.common.ChannelSocket.pause(ChannelSocket.java:284)
    at org.apache.jk.server.JkMain.pause(JkMain.java:725)
    at org.apache.jk.server.JkCoyoteHandler.pause(JkCoyoteHandler.java:153)
    at org.apache.catalina.connector.Connector.pause(Connector.java:1022)
    at org.apache.catalina.core.StandardService.stop(StandardService.java:563)
    at org.apache.catalina.core.StandardServer.stop(StandardServer.java:744)
    at org.apache.catalina.startup.Catalina.stop(Catalina.java:643)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:618)
    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:606)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
    Caused by: java.net.UnknownHostException: ip-172-30-0-186: Name or service not known
    at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
    at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:901)
    at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1293)
    at java.net.InetAddress.getLocalHost(InetAddress.java:1469)
    … 15 more

    Apr 10, 2015 5:02:34 AM org.apache.catalina.core.StandardService stop
    INFO: Stopping service Catalina
    Apr 10, 2015 5:02:34 AM org.apache.coyote.http11.Http11Protocol destroy
    INFO: Stopping Coyote HTTP/1.1 on http-8080
    Apr 10, 2015 5:02:35 AM org.apache.catalina.core.AprLifecycleListener init
    INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
    Apr 10, 2015 5:02:35 AM org.apache.coyote.http11.Http11Protocol init
    INFO: Initializing Coyote HTTP/1.1 on http-8080
    Apr 10, 2015 5:02:35 AM org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 818 ms
    Apr 10, 2015 5:02:35 AM org.apache.catalina.core.StandardService start
    INFO: Starting service Catalina
    Apr 10, 2015 5:02:35 AM org.apache.catalina.core.StandardEngine start
    INFO: Starting Servlet Engine: Apache Tomcat/6.0.24
    Apr 10, 2015 5:02:35 AM org.apache.catalina.startup.HostConfig deployDescriptor
    INFO: Deploying configuration descriptor manager.xml
    Apr 10, 2015 5:02:35 AM org.apache.catalina.startup.HostConfig deployDescriptor
    INFO: Deploying configuration descriptor W-j.xml
    Apr 10, 2015 5:02:35 AM org.apache.catalina.startup.HostConfig deployDescriptor
    INFO: Deploying configuration descriptor host-manager.xml
    Apr 10, 2015 5:02:36 AM org.apache.catalina.startup.HostConfig deployWAR
    INFO: Deploying web application archive solr.war
    Apr 10, 2015 5:02:36 AM org.apache.tomcat.util.digester.Digester fatalError
    SEVERE: Parse Fatal Error at line 40 column 4: The content of elements must consist of well-formed character data or markup.
    org.xml.sax.SAXParseException; systemId: jndi:/localhost/solr/WEB-INF/web.xml; lineNumber: 40; columnNumber: 4; The content of elements must consist of well-formed character data or markup.
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198)
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:441)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:368)
    at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1436)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.startOfMarkup(XMLDocumentFragmentScannerImpl.java:2636)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2734)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:648)
    at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1642)
    at org.apache.catalina.startup.ContextConfig.applicationWebConfig(ContextConfig.java:365)
    at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:1044)
    at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:265)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4616)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526)
    at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:905)
    at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:740)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:500)
    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    at org.apache.catalina.core.StandardService.start(StandardService.java:516)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:593)
    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:606)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

    Apr 10, 2015 5:02:36 AM org.apache.catalina.startup.ContextConfig applicationWebConfig
    SEVERE: Parse error in application web.xml file at jndi:/localhost/solr/WEB-INF/web.xml
    org.xml.sax.SAXParseException; systemId: jndi:/localhost/solr/WEB-INF/web.xml; lineNumber: 40; columnNumber: 4; The content of elements must consist of well-formed character data or markup.
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198)
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:441)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:368)
    at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1436)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.startOfMarkup(XMLDocumentFragmentScannerImpl.java:2636)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2734)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:648)
    at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1642)
    at org.apache.catalina.startup.ContextConfig.applicationWebConfig(ContextConfig.java:365)
    at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:1044)
    at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:265)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4616)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526)
    at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:905)
    at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:740)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:500)
    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    at org.apache.catalina.core.StandardService.start(StandardService.java:516)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:593)
    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:606)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

    Apr 10, 2015 5:02:36 AM org.apache.catalina.startup.ContextConfig applicationWebConfig
    SEVERE: Occurred at line 40 column 4
    Apr 10, 2015 5:02:36 AM org.apache.catalina.startup.ContextConfig start
    SEVERE: Marking this application unavailable due to previous error(s)
    Apr 10, 2015 5:02:36 AM org.apache.catalina.core.StandardContext start
    SEVERE: Error getConfigured
    Apr 10, 2015 5:02:36 AM org.apache.catalina.core.StandardContext start
    SEVERE: Context [/solr] startup failed due to previous errors
    Apr 10, 2015 5:02:36 AM org.apache.catalina.startup.HostConfig deployDirectory
    INFO: Deploying web application directory examples
    Apr 10, 2015 5:02:36 AM org.apache.catalina.startup.HostConfig deployDirectory
    INFO: Deploying web application directory sample
    Apr 10, 2015 5:02:37 AM org.apache.catalina.startup.HostConfig deployDirectory
    INFO: Deploying web application directory ROOT
    Apr 10, 2015 5:02:37 AM org.apache.coyote.http11.Http11Protocol start
    INFO: Starting Coyote HTTP/1.1 on http-8080
    Apr 10, 2015 5:02:37 AM org.apache.jk.common.ChannelSocket init
    INFO: JK: ajp13 listening on /0.0.0.0:8009
    Apr 10, 2015 5:02:37 AM org.apache.jk.server.JkMain start
    INFO: Jk running ID=0 time=0/60 config=null
    Apr 10, 2015 5:02:37 AM org.apache.catalina.startup.Catalina start
    INFO: Server startup in 2064 ms

  14. Great job, would be interesting to know how much time in total people save on instructions like this.

    In the latest Solr 5.1.0 there are no longer any .war file in the dist directory, but there is a solr.jar in /solr-5.1.0/server/webapps/solr.war. I have not tested it yet, but I presume I can use this file/version as well?

Leave a Reply