cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot set dir.root in custom .properties file

btr33
Champ in-the-making
Champ in-the-making
I have followed the instructions available in the alfresco wiki to make use of custom configuration files in order to override the alfresco maintained configs.

To set dir.root I have edited the file custom-repository.properties. However, this setting seems to have no effect as the dir.root is still pointing to the default ./alf_data (visible in catalina.out when starting tomcat).

Interestingly enough, the other settings that I have cahnged in the custom-repository.properties file are accepted (e.g. the database login information).

What am I doing wrong? Any help is greatly appreciated!
5 REPLIES 5

dewi
Champ in-the-making
Champ in-the-making
I have had the same problem. Find your "repository.properties" file, copy it in  "Tomcat 5.5\webapps\alfresco\WEB-INF\classes\alfresco" and fill it as you did for "custom-repository.properties"

I don't know if it is a good way but it works  Smiley Happy

ale_carraro
Champ in-the-making
Champ in-the-making
I've had this problem when running it from Eclipse: the dyrectory alf_data was created inside the eclipse dir!

the easiest solution (however not elegant) is to replace the entry with an absolute path (like /alf_data or c://alf_data)

abrugger
Champ in-the-making
Champ in-the-making
Are u sure that other properties in your custom-repository.properties file are really read?

I also tried to have a custom-repository.properties file in the alfreso/extension folder but so far no success!

I tried different names: repository.properties, repository-custom.properties file cause in the following news http://dev.alfresco.com/community/newsletters/2006/04/
it is said that repository.properties should work…

My conclusion so far is that the extension mechanisms only work with spring context xml files and to override repository properties you have to override the bean 'repository-properties' as stated here http://wiki.alfresco.com/wiki/Repository_Configuration

Can anyone confirm this?

cleseach
Star Contributor
Star Contributor
You must reference your custom-repository.properties file in a "-context.xml" one.
You will find exemples in alfresco/extension directory.


<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
   <bean id="repository-properties" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="ignoreUnresolvablePlaceholders">
            <value>true</value>
        </property>
        <property name="locations">
            <list>
                <value>classpath:alfresco/repository.properties</value>
                <value>classpath:alfresco/version.properties</value>
                <value>classpath:alfresco/domain/transaction.properties</value>

                <!– Override data location properties
                <value>classpath:alfresco/extension/custom-repository.properties</value>    –>
            </list>
        </property>
    </bean>
</beans>

@dewi : modifying files in classes/alfresco is a bad idea -> a new Alfresco install (e.g. version upgrade) will overwrite your changes.

btr33
Champ in-the-making
Champ in-the-making
Seems that I have found the solution:

Edit the following files in
tomcat/shared/classes/alfresco/extension

– custom-db-and-data-context.xml
remove the comment from
<value>classpath:alfresco/extension/custom-data-location.properties</value>

– custom-data-location.properties
This file must be created. Put the definition for dir.root in this file, e.g. dir.root=/opt/alfresco/data
This is the only line that I have put inside. No clue what other definitions can go in there.

Generally, I have found that some definitions are present in more than one file without clear indication what needs to go where (e.g. custom db connection parameters). I guess this is a case for learning by doing…

I hope this helps someone else too!