tomcat可以正常启动,能够访问localhost:8080,不能访问localhost:8080/solr

I have big problems installing Solr 4.3 under Ubuntu 12.04. Firstly i installed tomcat. I can access tomcat via browser on localhost:8080. Into "Tomcat Web Application Manager" i try to install Solr 4.3 via 2solr.war" file. The file is been uploaded an deployed. But i cant get it started. "FAIL - Application at context path /solr could not be started".

The log file (localhost.log) look like:

07.05.2013 11:05:36 org.apache.catalina.core.ApplicationContext log
INFO: HTMLManager: start: Starting web application at '/solr'
07.05.2013 11:05:36 org.apache.catalina.core.StandardContext filterStart
SCHWERWIEGEND: Exception starting filter SolrRequestFilter
org.apache.solr.common.SolrException: Could not find necessary SLF4j logging jars. If using Jetty, the SLF4j logging jars need to go in the jetty lib/ext directory. For other containers, the corresponding directory should be used. For more information, see: http://wiki.apache.org/solr/SolrLogging
    at org.apache.solr.servlet.SolrDispatchFilter.<init>(SolrDispatchFilter.java:105)
    ... 33 more
07.05.2013 11:05:36 org.apache.catalina.core.ApplicationContext log
INFO: HTMLManager: list: Listing contexts for virtual host 'localhost'
07.05.2013 11:05:36 org.apache.catalina.core.StandardContext filterStart
SCHWERWIEGEND: Exception starting filter SolrRequestFilter
org.apache.solr.common.SolrException: Could not find necessary SLF4j logging jars. If using Jetty, the SLF4j logging jars need to go in the jetty lib/ext directory. For other containers, the corresponding directory should be used. For more information, see: http://wiki.apache.org/solr/SolrLogging
    at org.apache.solr.servlet.SolrDispatchFilter.<init>(SolrDispatchFilter.java:105)
    ... 21 more

catalina.....log

07.05.2013 11:05:36 org.apache.catalina.core.StandardContext start
SCHWERWIEGEND: Error filterStart
07.05.2013 11:05:36 org.apache.catalina.core.StandardContext start
SCHWERWIEGEND: Context [/solr] startup failed due to previous errors
07.05.2013 11:05:36 org.apache.catalina.startup.HostConfig checkResources
INFO: Reloading context [/solr]
07.05.2013 11:05:36 org.apache.catalina.core.StandardContext stop
INFO: Container org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/solr] has not been started
07.05.2013 11:05:36 org.apache.catalina.core.StandardContext start
SCHWERWIEGEND: Error filterStart
07.05.2013 11:05:36 org.apache.catalina.core.StandardContext start
SCHWERWIEGEND: Context [/solr] startup failed due to previous errors

解决办法:As the logs say - Could not find necessary SLF4j logging jars.

You are missing the slf4j jars.

Place the slf4j jars in the $CATALINA_BASE/lib folder.

Copy the SLF4j logging jars from <solr>/example/lib/ext/*.jar into Tomcat Lib (e.g. TOMCAT_HOME/lib/usr/share/tomcat/lib) or Webapp Lib directory (e.g. TOMCAT_HOME/webapps/solr/WEB-INF/lib). These jars will set up SLF4J and log4j.

If using Jetty, the SLF4j logging jars need to go in the jetty lib/ext directory. For other containers, the corresponding directory should be used. For more information, see: http://wiki.apache.org/solr/SolrLogging

In other words to make your Solr working properly with Tomcat, you need to:

  1. Copy the SLF4j logging jars from <solr>/example/lib/ext/*.jar into Tomcat Lib (e.g. TOMCAT_HOME/lib/usr/share/tomcat/lib) or Webapp Lib directory (e.g. TOMCAT_HOME/webapps/solr/WEB-INF/lib). These jars will set up SLF4J and log4j.

    For a Debian or Ubuntu server using the Tomcat package available from the OS vendor, this is likely to be /usr/share/tomcat6/lib or /usr/share/tomcat7/lib.

    For example:

    # cp -v /opt/solr-4.10.4/example/lib/ext/*.jar /usr/share/tomcat?/lib/
    

    or:

    # cp -v /opt/solr-4.10.4/example/lib/ext/*.jar /var/lib/tomcat7/webapps/solr/WEB-INF/lib/
    

    Alternatively set-up your CLASSPATH to point to your jar files.

  2. Copy the logging config from solr/example/resources/log4j.properties into a location on the classpath. Usually you can use the same location as the jar files above and edit the configuration file for your preferred log destination.

    Optionally, if you did not place log4j.properties on the classpath, set java option: -Dlog4j.configuration=file:///path/to/log4j.properties

  3. Restart Tomcat (e.g. sudo /etc/init.d/tomcat7 restart).

If you still have the problems, it might help to start the server with -Dlog4j.debug=true to see more details.

See: Using the example logging setup in containers other than Jetty

最终解决办法:

1.sudo cp -v /usr/local/solr-4.10.3/example/lib/ext/*.jar /usr/local/apache-tomcat-8.0.33/lib

2.sudo cp -v /usr/local/solr-4.10.3/example/resources/log4j.properties /usr/local/apache-tomcat-8.0.33/lib

3.sudo ./shutdown.sh

4.sudo ./startup.sh

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值