Container configuration
Each eXo container service may has configuration. Most of services has one with defaults which comes with the service JAR. Each configurable service may be reconfigured to override defaults or set additional parameters. When container starts it searches for services and its configurations. And if the service has configured in two or more places the configuration override mechanism will be used.Configurations search
Container performs following steps making eXo Container configurations search depending on container type.Configurations apply order for PortalContainer
The container is initialized by looking into different locations. Configurations are overloaded in the following lookup sequence :- Services default RootContainer configurations from JAR files /conf/configuration.xml
- External RootContainer configuration, if will be found at $AS_HOME/exo-conf/configuration.xml
- Services default PortalContainer configurations from JAR files /conf/portal/configuration.xml
- Web applications configurations from WAR files /WEB-INF/conf/configuration.xml
- External configuration for services of named portal, if will be found at $AS_HOME/exo-conf/portal/PORTAL_NAME/configuration.xml (since kernel 2.0.3)
Configurations apply order for StandaloneContainer
- Services default RootContainer configurations from JAR files /conf/configuration.xml
- External RootContainer configuration, if will be found at $AS_HOME/exo-conf/configuration.xml
// add configuration to the default services configurations from JARs/WARs
StandaloneContainer.addConfigurationURL(containerConf);- Services default StandaloneContainer configurations from JAR files /conf/portal/configuration.xml
- Web applications configurations from WAR files /WEB-INF/conf/configuration.xml
- Configuration from added URL containerConf will override only services configured in the file
// full services configuration will be used instead of default ones from services JARs/WARs
StandaloneContainer.setConfigurationURL(containerConf);- Overridden configuration only will be used (DEPRECATED, it's requirement to configure ALL services on which an application depends).
- Services default StandaloneContainer configurations from JAR files /conf/portal/configuration.xml
- Web applications configurations from WAR files /WEB-INF/conf/configuration.xml
- External configuration for StandaloneContainer services, if will be found at $AS_HOME/exo-configuration.xml. If $AS_HOME/exo-configuration.xml doesn't exist and StandaloneContainer instance obtained with dedicated configuration classloader the container will try to search resource conf/exo-configuration.xml within the given classloader.
Notes
After the processing of all configuration available in system the container will initialize it and start each service in order of dependency injection (DI). In common case the user/developer should be careful in configuration of same service in different configuration files. It's recommended to configure service in own JAR only. Or, in case of portal configuration, strictly reconfigure valuable services in portal WAR files or in external configuration. There are services that can be (or should be) configured some times. It's individual and depends on business logic of the service. A service may initialize same resource (shared with other services) or may add a particular object to a set of objects (shared for other services too). In first case it's a critical who will be the last, i.e. whose configuration will be used. In second case it's no matter who the first who the last (if parameter objects are independent).Configuration search log
In case of problems with service configuration it's important to know from which JAR/WAR it comes. For that purpose JVM system property org.exoplatform.container.configuration.debug can be used.java -Dorg.exoplatform.container.configuration.debug ...
......
Add configuration jar:file:/D:/Projects/eXo/dev/exo-working/exo-tomcat/lib/exo.kernel.container-trunk.jar!/conf/portal/configuration.xml
Add configuration jar:file:/D:/Projects/eXo/dev/exo-working/exo-tomcat/lib/exo.kernel.component.cache-trunk.jar!/conf/portal/configuration.xml
Add configuration jndi:/localhost/portal/WEB-INF/conf/configuration.xml
import jndi:/localhost/portal/WEB-INF/conf/common/common-configuration.xml
import jndi:/localhost/portal/WEB-INF/conf/database/database-configuration.xml
import jndi:/localhost/portal/WEB-INF/conf/ecm/jcr-component-plugins-configuration.xml
import jndi:/localhost/portal/WEB-INF/conf/jcr/jcr-configuration.xml
......
on 10/12/2008 at 13:52