开发者

deploy war in Tomcat [duplicate]

This question already has an answer here: Closed 11 years ago.

Possible Duplicate:

deploy war in Tomcat

I Deployed solr.war in tomcat webapps folder and extracted it. while running it in on browser i am gettong the following exception. please suggest me what i need to do for it.

SEVERE: Could not start SOLR. Check solr/home property java.lang.RuntimeException: Can't find resource 'solrconfig.xml' in classpath or 'solr/conf/', cwd=C:\Program Files\Apache Software Foundation\Tomcat 5.5 at org.apache.solr.core.SolrResourceLoader.openResource(SolrResourceLoader.java:260) at org.apache.solr.core.SolrResourceLoader.openConfig(SolrResourceLoader.java:228) at org.apache.solr.core.Config.(Config.java:101) at org.apache.s开发者_StackOverflow中文版olr.core.SolrConfig.(SolrConfig.java:130) at org.apache.solr.core.CoreContainer$Initializer.initialize(CoreContainer.java:134) at org.apache.solr.servlet.SolrDispatchFilter.init(SolrDispatchFilter.java:83) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:221) at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:302) at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:78) at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3635) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4222) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:831) at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:720) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490) at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1217) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120) at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1306) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1570) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1579) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1559) at java.lang.Thread.run(Unknown Source)


Do what the error says: place solrconfig.xmlin your classpath (C:\Program Files\Apache Software Foundation\Tomcat 5.5\classes) or in the solr/conf/ folder.


a) The reason being you haven't set the SOLR_HOME property. When you define the $SOLR_HOME it looks for a SOLR_HOME/solr/conf/solrconfig.xml which defines the data directory for solr. This data directory is nothing but a place where Solr stores index.
b) Also, you need to add the SolrContext.xml file in $TOMCAT_HOME/conf/Catalina/localhost which specifies the location of war and the solr home. It automatically picks up the solr.war from this position and copies it to webapps folder.

Follow this link for detail instruction. http://wiki.apache.org/solr/SolrTomcat#Simple_Example_Install


Watch that the solr war doesn't have a preconfigured "solr/home" with preconfigured cores inside the .war, you have to make the solr.xml (I use Jetty, so it's the solr.xml in the context's directory) point to a valid solr/home with a configured core.

I would suggest you start by looking at the solr examples that come with the binaries. Personally i made strides once i had a solr environment set up in eclipse http://www.lucidimagination.com/developers/articles/setting-up-apache-solr-in-eclipse.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜