You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by rocco2004 <st...@gmail.com> on 2011/10/10 03:07:20 UTC

Error Finding solrconfig.xml

Hello,

I'm having issues setting up Solr as Tomcat service in CentOS. I’m using
solr 3.3.0 which should be working with Tomcat 5.5. The error I was getting
is:

Can't find resource 'solrconfig.xml' in classpath or
'/home/datadmin/public_html/apache-solr/example/solr/./conf/',
cwd=/usr/local/jakarta/apache-tomcat-5.5.33/bin

I did the following:

1.	Copied solr.war to tomcat/webapps
2.	Restarted Tomcat Service
3.	Edited /usr/local/jakarta/tomcat/webapps/solr/WEB-INF/web.xml   as:

<env-entry>
       <env-entry-name>solr/home</env-entry-name>
      
<env-entry-value>/home/datadmin/public_html/apache-solr/example/solr</env-entry-value>
       <env-entry-type>java.lang.String</env-entry-type>
    </env-entry>


3. Created solr.xml in /usr/local/jakarta/tomcat/conf/Catalina/localhost as:

<?xml version="1.0" encoding="utf-8"?>
<Context docBase="/usr/local/jakarta/tomcat/webapps/solr.war" debug="0"
crossContext="true">
  <Environment name="solr/home" type="java.lang.String"
value="/home/datadmin/public_html/apache-solr/example"   
   override="true"/>
</Context>


Below is the complete error log from catalina.err:


Oct 9, 2011 7:35:06 PM org.apache.catalina.core.StandardService stop
INFO: Stopping service Catalina
Oct 9, 2011 7:35:06 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextDestroyed()
Oct 9, 2011 7:35:06 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextDestroyed()
Oct 9, 2011 7:35:06 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextDestroyed()
Oct 9, 2011 7:35:06 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextDestroyed()
Oct 9, 2011 7:35:06 PM org.apache.coyote.http11.Http11BaseProtocol destroy
INFO: Stopping Coyote HTTP/1.1 on http-8080
Oct 9, 2011 7:35:21 PM 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/local/jdk/jre/lib/amd64/server:/usr/local/jdk/jre/lib/amd64:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
Oct 9, 2011 7:35:23 PM org.apache.coyote.http11.Http11BaseProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Oct 9, 2011 7:35:23 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 2875 ms
Oct 9, 2011 7:35:23 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Oct 9, 2011 7:35:23 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.33
Oct 9, 2011 7:35:23 PM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Oct 9, 2011 7:35:24 PM org.apache.catalina.startup.HostConfig
deployDescriptor
WARNING: A docBase /usr/local/jakarta/tomcat/webapps/solr.war inside the
host appBase has been specified, and will be ignored
Oct 9, 2011 7:35:25 PM org.apache.solr.core.SolrResourceLoader
locateSolrHome
INFO: Using JNDI solr.home:
/home/datadmin/public_html/apache-solr/example/solr
Oct 9, 2011 7:35:25 PM org.apache.solr.core.SolrResourceLoader <init>
INFO: Solr home set to
'/home/datadmin/public_html/apache-solr/example/solr/'
Oct 9, 2011 7:35:25 PM org.apache.solr.servlet.SolrDispatchFilter init
INFO: SolrDispatchFilter.init()
Oct 9, 2011 7:35:25 PM org.apache.solr.core.SolrResourceLoader
locateSolrHome
INFO: Using JNDI solr.home:
/home/datadmin/public_html/apache-solr/example/solr
Oct 9, 2011 7:35:25 PM org.apache.solr.core.CoreContainer$Initializer
initialize
INFO: looking for solr.xml:
/home/datadmin/public_html/apache-solr/example/solr/solr.xml
Oct 9, 2011 7:35:25 PM org.apache.solr.core.SolrResourceLoader
locateSolrHome
INFO: Using JNDI solr.home:
/home/datadmin/public_html/apache-solr/example/solr
Oct 9, 2011 7:35:25 PM org.apache.solr.core.CoreContainer <init>
INFO: New CoreContainer:
solrHome=/home/datadmin/public_html/apache-solr/example/solr/
instance=1537767228
Oct 9, 2011 7:35:25 PM org.apache.solr.core.SolrResourceLoader <init>
INFO: Solr home set to
'/home/datadmin/public_html/apache-solr/example/solr/'
Oct 9, 2011 7:35:26 PM org.apache.solr.core.SolrResourceLoader <init>
INFO: Solr home set to
'/home/datadmin/public_html/apache-solr/example/solr/./'
Oct 9, 2011 7:35:26 PM org.apache.solr.common.SolrException log
SEVERE: java.lang.RuntimeException: Can't find resource 'solrconfig.xml' in
classpath or '/home/datadmin/public_html/apache-solr/example/solr/./conf/',
cwd=/usr/local/jakarta/apache-tomcat-5.5.33/bin
	at
org.apache.solr.core.SolrResourceLoader.openResource(SolrResourceLoader.java:268)
	at
org.apache.solr.core.SolrResourceLoader.openConfig(SolrResourceLoader.java:234)
	at org.apache.solr.core.Config.<init>(Config.java:141)
	at org.apache.solr.core.SolrConfig.<init>(SolrConfig.java:131)
	at org.apache.solr.core.CoreContainer.create(CoreContainer.java:435)
	at org.apache.solr.core.CoreContainer.load(CoreContainer.java:316)
	at
org.apache.solr.core.CoreContainer$Initializer.initialize(CoreContainer.java:133)
	at
org.apache.solr.servlet.SolrDispatchFilter.init(SolrDispatchFilter.java:94)
	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.<init>(ApplicationFilterConfig.java:78)
	at
org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3666)
	at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4258)
	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.deployDescriptor(HostConfig.java:634)
	at
org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:561)
	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:496)
	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1203)
	at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:319)
	at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
	at org.apache.catalina.core.StandardService.start(StandardService.java:448)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at
org.apache.commons.daemon.support.DaemonLoader.start(DaemonLoader.java:219)

Oct 9, 2011 7:35:26 PM org.apache.solr.servlet.SolrDispatchFilter init
INFO: user.dir=/usr/local/jakarta/apache-tomcat-5.5.33/bin
Oct 9, 2011 7:35:26 PM org.apache.solr.servlet.SolrDispatchFilter init
INFO: SolrDispatchFilter.init() done
Oct 9, 2011 7:35:26 PM org.apache.solr.servlet.SolrServlet init
INFO: SolrServlet.init()
Oct 9, 2011 7:35:26 PM org.apache.solr.core.SolrResourceLoader
locateSolrHome
INFO: Using JNDI solr.home:
/home/datadmin/public_html/apache-solr/example/solr
Oct 9, 2011 7:35:26 PM org.apache.solr.servlet.SolrServlet init
INFO: SolrServlet.init() done
Oct 9, 2011 7:35:26 PM org.apache.solr.core.SolrResourceLoader
locateSolrHome
INFO: Using JNDI solr.home:
/home/datadmin/public_html/apache-solr/example/solr
Oct 9, 2011 7:35:26 PM org.apache.solr.servlet.SolrUpdateServlet init
INFO: SolrUpdateServlet.init() done
Oct 9, 2011 7:35:29 PM org.apache.catalina.core.ApplicationContext log
INFO: org.apache.webapp.balancer.BalancerFilter: init(): ruleChain:
[org.apache.webapp.balancer.RuleChain:
[org.apache.webapp.balancer.rules.URLStringMatchRule: Target string: News /
Redirect URL: http://www.cnn.com],
[org.apache.webapp.balancer.rules.RequestParameterRule: Target param name:
paramName / Target param value: paramValue / Redirect URL:
http://www.yahoo.com],
[org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL:
http://jakarta.apache.org]]
Oct 9, 2011 7:35:30 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
Oct 9, 2011 7:35:30 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
Oct 9, 2011 7:35:30 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
Oct 9, 2011 7:35:30 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
Oct 9, 2011 7:35:31 PM org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Oct 9, 2011 7:35:31 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Oct 9, 2011 7:35:31 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=1/30  config=null
Oct 9, 2011 7:35:31 PM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
Oct 9, 2011 7:35:31 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 8133 ms


Many thanks in advance for your help,

Best,
Peter


--
View this message in context: http://lucene.472066.n3.nabble.com/Error-Finding-solrconfig-xml-tp3408411p3408411.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Error Finding solrconfig.xml

Posted by rocco2004 <st...@gmail.com>.
Hi Hoss,

It ended up been permission issue. I moved the example folder to
/usr/local/jakarta/tomcat/webapps/solr/WEB-INF/ and it was able to find it.
Java seem to be giving file not found even if it doesn't have permissions to
access it. 

I'm wondering in such cases under what user runs tomcat and what is the best
practices to get permissions to external folder like
"/home/datadmin/public_html/apache-solr/example" ?


--
View this message in context: http://lucene.472066.n3.nabble.com/Error-Finding-solrconfig-xml-tp3408411p3441554.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Error Finding solrconfig.xml

Posted by Chris Hostetter <ho...@fucit.org>.
: Can't find resource 'solrconfig.xml' in classpath or
: '/home/datadmin/public_html/apache-solr/example/solr/./conf/',
: cwd=/usr/local/jakarta/apache-tomcat-5.5.33/bin

a) several of the steps you mention rever to 

/home/datadmin/public_html/apache-solr/example and 
/home/datadmin/public_html/apache-solr/example/solr but at no point have 
you told us wether you actually created either of those directories, or 
what you put in them.

: 3.	Edited /usr/local/jakarta/tomcat/webapps/solr/WEB-INF/web.xml   as:
	...
: 3. Created solr.xml in /usr/local/jakarta/tomcat/conf/Catalina/localhost as:

did you really do *both* of these? (they are both labeled step #3) ... you 
should only do one of them (i would recommend the later as it doesn't 
require mucking with the war file) and since you set the value of 
"solr/home to two differnet things in each case, i honestly have no idea 
which one will be used (i don't know what the precendence is in tomcat)

if you intend for "/home/datadmin/public_html/apache-solr/example" to be 
your solr home dir, then it should contain either a "solr.xml" (for 
multicore setups) like this one...

https://svn.apache.org/repos/asf/lucene/dev/tags/lucene_solr_3_3/solr/example/solr/solr.xml

...which points at your various cores, or it should contain a "conf/" 
subdir and a "conf/solrconfig.xml" file like this one...

https://svn.apache.org/repos/asf/lucene/dev/tags/lucene_solr_3_3/solr/example/solr/conf/solrconfig.xml



-Hoss