cancel
Showing results for 
Search instead for 
Did you mean: 

Adding custom settings

tyoung
Champ in-the-making
Champ in-the-making
I have some questions about the config changes from ver 1.1.2 and the 1.2.0 versions before you set the alf_data directory in repository.properties but now you need a extension file in

      ../jboss/server/default/conf/alfresco/extension

to make your config changes? I seen mentioned in the wiki about changing your custom setting to

      etc/alfresco/config

and putting your changes there but I guess I am confused as to what I need to do to create the custom setting and have them looked up from there.

Thanks

T
10 REPLIES 10

gavinc
Champ in-the-making
Champ in-the-making
Correct.

Basically any spring config file ending with -content.xml placed in the folder you mentioned will automatically get read in during startup.

If you place a file in there that overrides the bean that loads all the repository settings you can point to a custom repository.properties file. This means in the future, when you upgrade, you shouldn't need to make the same config changes again.

The following example will load a custom repository.properties file from /etc/alfresco/config.

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

                <value>file:/etc/alfresco/config/repository.properties</value>  <!– override core properties –>
            </list>
        </property>
    </bean>

Your /etc/alfresco/config/repository.properties file then only needs to have the alf_data property in it, for example:

dir.root=/srv/alfresco/data

Hope that helps.

tyoung
Champ in-the-making
Champ in-the-making
Hi,

ok I put in a file called core-services-context.xml
in the jboss/server/default/conf/alfresco/extension folder
and created a repository.properties file in /etc/alfresco/config

but I can't get the alfresco.war to load


Here are some highlights of the errors I get.

2006-03-23 09:35:51,237 ERROR [org.springframework.web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: Line 1 in XML document from file [/home/alfresco/alfresco/jboss/server/default/conf/alfresco/extension/core-services-context.xml] is invalid; nested exception is org.xml.sax.SAXParseException: Document root element "bean", must match DOCTYPE root "null".
org.xml.sax.SAXParseException: Document root element "bean", must match DOCTYPE root "null".


2006-03-23 09:35:52,037 ERROR [org.apache.catalina.core.StandardContext] Error listenerStart
2006-03-23 09:35:52,055 ERROR [org.apache.catalina.core.StandardContext] Context [/alfresco] startup failed due to previous errors
2006-03-23 09:35:52,093 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/alfresco]] Exception sending context destroyed event to listener instance of class org.alfresco.web.app.ContextListener
org.springframework.beans.factory.BeanDefinitionStoreException: Line 1 in XML document from file [/home/alfresco/alfresco/jboss/server/default/conf/alfresco/extension/core-services-context.xml] is invalid; nested exception is org.xml.sax.SAXParseException: Document root element "bean", must match DOCTYPE root "null".
org.xml.sax.SAXParseException: Document root element "bean", must match DOCTYPE root "null".


2006-03-23 09:35:52,344 INFO  [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/alfresco]] Closing Spring root WebApplicationContext
2006-03-23 09:35:52,399 WARN  [org.jboss.system.ServiceController] Problem starting service jboss.web.deployment:war=alfresco.war,id=1437698285
org.jboss.deployment.DeploymentException: URL file:/home/alfresco/alfresco/jboss/server/default/tmp/deploy/tmp2696alfresco.war/ deployment failed


2006-03-23 09:35:54,116 ERROR [org.jboss.deployment.scanner.URLDeploymentScanner] Incomplete Deployment listing:

— Incompletely deployed packages —
org.jboss.deployment.DeploymentInfo@55b188ed { url=file:/home/alfresco/alfresco/jboss/server/default/deploy/alfresco.war }
  deployer: MBeanProxyExt[jboss.web:service=WebServer]
  status: Deployment FAILED reason: URL file:/home/alfresco/alfresco/jboss/server/default/tmp/deploy/tmp2696alfresco.war/ deployment failed
  state: FAILED
  watch: file:/home/alfresco/alfresco/jboss/server/default/deploy/alfresco.war
  altDD: null
  lastDeployed: 1143142509916
  lastModified: 1143142508000
  mbeans:

— MBeans waiting for other MBeans —
ObjectName: jboss.web.deployment:war=alfresco.war,id=1437698285
  State: FAILED
  Reason: org.jboss.deployment.DeploymentException: URL file:/home/alfresco/alfresco/jboss/server/default/tmp/deploy/tmp2696alfresco.war/ deployment failed

— MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM —
ObjectName: jboss.web.deployment:war=alfresco.war,id=1437698285
  State: FAILED
  Reason: org.jboss.deployment.DeploymentException: URL file:/home/alfresco/alfresco/jboss/server/default/tmp/deploy/tmp2696alfresco.war/ deployment failed


Any help is appreciated

Thanks

T

gavinc
Champ in-the-making
Champ in-the-making
core-services-context.xml is the name of one of our spring config files. Spring will not load the same named file twice so this may well explain the errors you are seeing.

Try giving your file a name that doesn't clash with ours and see if that solves the errors.

tyoung
Champ in-the-making
Champ in-the-making
I still get the same error on startup using a different -context.xml name file.

gavinc
Champ in-the-making
Champ in-the-making
Could you possibly post the contents of your custom -context.xml file?

tyoung
Champ in-the-making
Champ in-the-making
I added just what you posted earlier…

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

                <value>file:/etc/alfresco/config/repository.properties</value>  <!– override core properties –>
            </list>
        </property>
    </bean>


and created a repository.properties file in /etc/alfresco/config
with

dir.root=/home/alfresco/alfresco

am I supposed to change someing in the -context.xml file?

thaneshk
Champ in-the-making
Champ in-the-making
Where do you create the folder structure /etc/alfresco/config

gavinc
Champ in-the-making
Champ in-the-making
Tyoung,

OK, sorry, i should have been clearer, what i posted was just the body of the XML, you'll need the surrounding <beans> element too. I have posted what you should have below:


<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>

<beans>

    <!– overriding to point to custom properties –>
    <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>

                <value>file:/etc/alfresco/config/repository.properties</value>
            </list>
        </property>
    </bean>

</beans>


thaneshk,

/etc/alfresco/config is a unix style path, this is the standard place on linux to store configuration files. If you are using windows you can store them anywhere so yours maybe for example…

<value>file:c:/my-alfresco-config/repository.properties</value>

thaneshk
Champ in-the-making
Champ in-the-making
Thanx Mate,

Cheers