cancel
Showing results for 
Search instead for 
Did you mean: 

Manual Installation Solr4 can't ind collection1/solrconfig.xml?

mxc
Confirmed Champ
Confirmed Champ
Hi all,

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
2 REPLIES 2

ericlemanissier
Champ in-the-making
Champ in-the-making
I have the exact same problem in the same configuration:
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"

briant
Champ on-the-rise
Champ on-the-rise

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 )

Welcome to the new Hyland Connect. Get started or submit feedback.