Manual Installation Solr4 can't ind collection1/solrconfig.xml?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2015 12:27 PM
I have completed a manual install of the Alfresco 5.0.d war file along with the solr4 war. On start up I get an error whose root cause is
Caused by: org.apache.solr.common.SolrException: Error loading solr config from /usr/local/alfresco/solr4/collection1/solrconfig.xml
I have not defined the collection1. I have not defined this core anywhere and I can't find any reference to it in the config files.
I have the solr4.xml context file in the correct place under Catalina/localhost/solr4.xml.
Any help appreciated.
thanks
- Labels:
-
Archive
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2015 01:20 PM
2015-12-28 18:00:28,842 ERROR [solr.core.CoreContainer] [coreLoadExecutor-5-thread-1] Unable to create core: collection1 org.apache.solr.common.SolrException: Could not load core configuration for core collection1 at org.apache.solr.core.ConfigSetService.getConfig(ConfigSetService.java:66) at org.apache.solr.core.CoreContainer.create(CoreContainer.java:554) at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:261) at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:253) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)Caused by: org.apache.solr.common.SolrException: Error loading solr config from /usr/local/tomcat/solr4/collection1/solrconfig.xml at org.apache.solr.core.SolrConfig.readFromResourceLoader(SolrConfig.java:148) at org.apache.solr.core.ConfigSetService.createSolrConfig(ConfigSetService.java:79) at org.apache.solr.core.ConfigSetService.getConfig(ConfigSetService.java:61) … 9 moreCaused by: java.io.IOException: Can't find resource 'solrconfig.xml' in classpath or '/usr/local/tomcat/solr4/collection1/conf' at org.apache.solr.core.SolrResourceLoader.openResource(SolrResourceLoader.java:362) at org.apache.solr.core.SolrResourceLoader.openConfig(SolrResourceLoader.java:308) at org.apache.solr.core.Config.<init>(Config.java:116) at org.apache.solr.core.Config.<init>(Config.java:86) at org.apache.solr.core.SolrConfig.<init>(SolrConfig.java:161) at org.apache.solr.core.SolrConfig.readFromResourceLoader(SolrConfig.java:144)more2015-12-28 18:00:28,849 ERROR [solr.core.CoreContainer] [coreLoadExecutor-5-thread-1] null:org.apache.solr.common.SolrException: Unable to create core: collection1 at org.apache.solr.core.CoreContainer.recordAndThrow(CoreContainer.java:911) at org.apache.solr.core.CoreContainer.create(CoreContainer.java:568) at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:261) at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:253) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)Caused by: org.apache.solr.common.SolrException: Could not load core configuration for core collection1 at org.apache.solr.core.ConfigSetService.getConfig(ConfigSetService.java:66) at org.apache.solr.core.CoreContainer.create(CoreContainer.java:554) … 8 moreCaused by: org.apache.solr.common.SolrException: Error loading solr config from /usr/local/tomcat/solr4/collection1/solrconfig.xml at org.apache.solr.core.SolrConfig.readFromResourceLoader(SolrConfig.java:148) at org.apache.solr.core.ConfigSetService.createSolrConfig(ConfigSetService.java:79) at org.apache.solr.core.ConfigSetService.getConfig(ConfigSetService.java:61) … 9 moreCaused by: java.io.IOException: Can't find resource 'solrconfig.xml' in classpath or '/usr/local/tomcat/solr4/collection1/conf' at org.apache.solr.core.SolrResourceLoader.openResource(SolrResourceLoader.java:362) at org.apache.solr.core.SolrResourceLoader.openConfig(SolrResourceLoader.java:308) at org.apache.solr.core.Config.<init>(Config.java:116) at org.apache.solr.core.Config.<init>(Config.java:86) at org.apache.solr.core.SolrConfig.<init>(SolrConfig.java:161) at org.apache.solr.core.SolrConfig.readFromResourceLoader(SolrConfig.java:144)
I found this issue : https://issues.alfresco.com/jira/browse/ACE-2421 but the proposed solution "Rename tomcat/Catalina/localhost/solr.xml to solr4.xml" is useless because it already has the correct name, and I don't know what I should change to "change docBase parameter to point to solr4.war"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2016 04:26 AM
I stumbled across that same link and the advice "change docBase" eventually led me to discover that the default xml file has placeholder values in it that are not expanded during startup but rather need (actually MUST) be replaced with the actual values from your system. And it needs to be moved and renamed. I assume the installer does automatically which is why our manual setup needs to have it completed. And it is in the docs too, but they are a little unclear - it is step 3 here:
Installing and configuring Solr | Alfresco Documentation
Despite reading that page several times, it was unclear that I needed to change the template values @@ALFRESCO_SOLR4_DIR@@, etc to represent the actual paths on my system - it appeared these would be set by some startup script or other but that is not the case for me.
In my case I was able to review the contents of the formerly working system to see that this context.xml file located in /opt/alfresco/solr4/:
<?xml version="1.0" encoding="utf-8"?>
<Context debug="0" crossContext="true">
<Environment name="solr/home" type="java.lang.String" value="@@ALFRESCO_SOLR4_DIR@@" override="true"/>
<Environment name="solr/model/dir" type="java.lang.String" value="@@ALFRESCO_SOLR4_MODEL_DIR@@" override="true"/>
<Environment name="solr/content/dir" type="java.lang.String" value="@@ALFRESCO_SOLR4_CONTENT_DIR@@" override="true"/>
</Context>
...should be: 1) changed to the config below (in my configuration), 2) moved from /opt/alfresco/solr4/ to opt/alfresco/tomcat/conf/Catalina/localhost/ and saved as solr4.xml (note the file is originally named context.xml - it must be renamed solr4.xml).
...
<Environment name="solr/home" type="java.lang.String" value="/opt/alfresco/solr4" override="true"/>
<Environment name="solr/model/dir" type="java.lang.String" value="/opt/alfresco/alf_data/solr4/model" override="true"/>
<Environment name="solr/content/dir" type="java.lang.String" value="/opt/alfresco/alf_data/solr4/content"...
Everything worked perfectly after that.
(Aside: This install has been migrated and teleported across operating systems from Linux native install 5.0.c -> FreeBSD 9 jail -> FreeBSD10 jail -> upgrade 5.1f/5.1g (using native FreeBSD OpenJDK8, postgres, ImageMagick, LibreOffice, swftools, natively compiled Tomcat library, nginx reverse proxy). Alfresco on ZFS - what could be better )