How is the ATG CONFIGPATH built?

The CONFIGPATH in ATG is not an operating system variable. In other words, you don’t issue something like the following…

export CONFIGPATH=/directory_a /directory_B /directory_B
start_app.sh

The CONFIGPATH is pretty much what it sounds like. If you have done any work with things such as CLASSPATH or PATH in Linux, it is a similar concept. Basically, you can set properties in a given relative file location that override what was set for the same relative path location “earlier” in the CONFIGPATH.

For example, if ATG ships with a path in its core configuration that is name /atg/foo/bar/some.properties, you can override the values in this default out of of the box value by placing a file name some.properties in a path named /atg/foo/bar/, with a different relative start such as /opt/atg/ATG-Data. The JNDI lookup done in the ATG programs will use the last value found in the CONFIGPATH with the same relative name, rather than the out of the box value found in a config.jar found somewhere in the core ATG CONFIGPATH.

ATG “calculates” the CONFIGPATH and the order of its entries for you by examining several configuration files, as well as using some hardcoded rules.

Let’s assume we have the following modules configured to be loaded:

atg.dynamo.modules=MyModule,MyModule.MyModule2,DCS,PubPortlet,DafEar,

Incidentally, this is the exact same order as we specified when we built our EAR using runAssembler, except for DafEar which we didn’t specify but was added automatically.

We then see the following CONFIGPATH setting in our application server startup log

CONFIGPATH=

     /opt/jboss/server/MyServer/deploy/mymod.ear/atg_bootstrap.war/WEB-INF/ATG-INF/MyModule/config,
     /opt/jboss/server/MyServer/deploy/mymod.ear/atg_bootstrap.war/WEB-INF/ATG-INF/MyModule/MyModule2/config,
     /opt/jboss/server/MyServer/deploy/mymod.ear/atg_bootstrap.war/WEB-INF/ATG-INF/DAS/config/config.jar,
     /opt/jboss/server/MyServer/deploy/mymod.ear/atg_bootstrap.war/WEB-INF/ATG-INF/DAS/config/oca-ldap.jar,
     vfs[localconfig-1]=/atg/dynamo/service/groupconfig/ClientNodeTypeVirtualFileSystem,
     vfs[localconfig-1]=/atg/dynamo/service/groupconfig/ClientInstanceVirtualFileSystem,
     /opt/jboss/server/MyServer/deploy/mymod.ear/atg_bootstrap.war/WEB-INF/ATG-INF/DAS/liveconfig,
     /opt/jboss/server/MyServer/deploy/mymod.ear/atg_bootstrap.war/WEB-INF/ATG-INF/FlexUI/config/config.jar,
     /opt/jboss/server/MyServer/deploy/mymod.ear/atg_bootstrap.war/WEB-INF/ATG-INF/DAF/Deployment/config/config.jar,
     /opt/jboss/server/MyServer/deploy/mymod.ear/atg_bootstrap.war/WEB-INF/ATG-INF/DAF/Deployment/liveconfig/config.jar,
     /opt/jboss/server/MyServer/deploy/mymod.ear/atg_bootstrap.war/WEB-INF/ATG-INF/RL/config,
     /opt/jboss/server/MyServer/deploy/mymod.ear/atg_bootstrap.war/WEB-INF/ATG-INF/DAS-UI/config/uiconfig.jar,
     /opt/jboss/server/MyServer/deploy/mymod.ear/atg_bootstrap.war/WEB-INF/ATG-INF/DAS-UI/liveconfig,
     /opt/jboss/server/MyServer/deploy/mymod.ear/atg_bootstrap.war/WEB-INF/ATG-INF/DafEar/base/config/dafconfig.jar,
     /opt/jboss/server/MyServer/deploy/mymod.ear/atg_bootstrap.war/WEB-INF/ATG-INF/DafEar/JBoss/config/tomcatconfig.jar,
     /opt/jboss/server/MyServer/deploy/mymod.ear/atg_bootstrap.war/WEB-INF/ATG-INF/DPS/config/targeting.jar,
     /opt/jboss/server/MyServer/deploy/mymod.ear/atg_bootstrap.war/WEB-INF/ATG-INF/DPS/config/oca-cms.jar,
     /opt/jboss/server/MyServer/deploy/mymod.ear/atg_bootstrap.war/WEB-INF/ATG-INF/DPS/config/oca-html.jar,
     /opt/jboss/server/MyServer/deploy/mymod.ear/atg_bootstrap.war/WEB-INF/ATG-INF/DPS/config/oca-xml.jar,
     /opt/jboss/server/MyServer/deploy/mymod.ear/atg_bootstrap.war/WEB-INF/ATG-INF/DPS/config/userprofiling.jar,
     /opt/jboss/server/MyServer/deploy/mymod.ear/atg_bootstrap.war/WEB-INF/ATG-INF/DPS/config/profile.jar,
     /opt/jboss/server/MyServer/deploy/mymod.ear/atg_bootstrap.war/WEB-INF/ATG-INF/DPS/liveconfig,
     /opt/jboss/server/MyServer/deploy/mymod.ear/atg_bootstrap.war/WEB-INF/ATG-INF/DPS/InternalUsers/config/config.jar,
     /opt/jboss/server/MyServer/deploy/mymod.ear/atg_bootstrap.war/WEB-INF/ATG-INF/DPS/InternalUsers/liveconfig,
     /opt/jboss/server/MyServer/deploy/mymod.ear/atg_bootstrap.war/WEB-INF/ATG-INF/DSS/config/config.jar,
     /opt/jboss/server/MyServer/deploy/mymod.ear/atg_bootstrap.war/WEB-INF/ATG-INF/DSS/liveconfig,
     /opt/jboss/server/MyServer/deploy/mymod.ear/atg_bootstrap.war/WEB-INF/ATG-INF/DCS/config/config.jar,
     /opt/jboss/server/MyServer/deploy/mymod.ear/atg_bootstrap.war/WEB-INF/ATG-INF/DCS/liveconfig,
     /opt/jboss/server/MyServer/deploy/mymod.ear/atg_bootstrap.war/WEB-INF/ATG-INF/DSS/InternalUsers/config/config.jar,
     /opt/jboss/server/MyServer/deploy/mymod.ear/atg_bootstrap.war/WEB-INF/ATG-INF/DSS/InternalUsers/liveconfig,
     /opt/jboss/server/MyServer/deploy/mymod.ear/atg_bootstrap.war/WEB-INF/ATG-INF/Publishing/base/config,
     vfs[localconfig-1]=/atg/epub/file/ConfigFileSystem,
     /opt/jboss/server/MyServer/deploy/mymod.ear/atg_bootstrap.war/WEB-INF/ATG-INF/Publishing/base/jbossconfig,
     /opt/jboss/server/MyServer/deploy/mymod.ear/atg_bootstrap.war/WEB-INF/ATG-INF/Publishing/base/liveconfig,
     /opt/jboss/server/MyServer/deploy/mymod.ear/atg_bootstrap.war/WEB-INF/ATG-INF/DAS/Versioned/config/config.jar,
     /opt/jboss/server/MyServer/deploy/mymod.ear/atg_bootstrap.war/WEB-INF/ATG-INF/DAS/Versioned/liveconfig/config.jar,
     /opt/jboss/server/MyServer/deploy/mymod.ear/atg_bootstrap.war/WEB-INF/ATG-INF/DPS/Versioned/config/config.jar,
     /opt/jboss/server/MyServer/deploy/mymod.ear/atg_bootstrap.war/WEB-INF/ATG-INF/WebUI/config/config.jar,
     /opt/jboss/server/MyServer/deploy/mymod.ear/atg_bootstrap.war/WEB-INF/ATG-INF/WebUI/Management/config/config.jar,
     /opt/jboss/server/MyServer/deploy/mymod.ear/atg_bootstrap.war/WEB-INF/ATG-INF/BCC/config/config.jar,
     /opt/jboss/server/MyServer/deploy/mymod.ear/atg_bootstrap.war/WEB-INF/ATG-INF/BIZUI/config/config.jar,
     /opt/jboss/server/MyServer/deploy/mymod.ear/atg_bootstrap.war/WEB-INF/ATG-INF/AssetUI/config/config.jar,
     /opt/jboss/server/MyServer/deploy/mymod.ear/atg_bootstrap.war/WEB-INF/ATG-INF/DPS-UI/config/config.jar,
     /opt/jboss/server/MyServer/deploy/mymod.ear/atg_bootstrap.war/WEB-INF/ATG-INF/PubPortlet/config,
     /opt/jboss/server/MyServer/deploy/mymod.ear/atg_bootstrap.war/WEB-INF/ATG-INF/home/localconfig,
     /opt/atg/ATG-Data/localconfig,
     /opt/jboss/server/MyServer/deploy/mymod.ear/atg_bootstrap.war/WEB-INF/ATG-INF/home/servers/MyServer/localconfig,
     /opt/atg/ATG-Data/servers/MyServer/localconfig

As indicated in the DCS META-INF/MANIFEST.MF file, DCS requires DPS and DSS

ATG-Required: DPS DSS

As such, we first see our MyModule and MyModule.MyModule2 sub-module loaded, just as is shown in our dynamo.env modules variable. We then see the DCS and supporting configuration files read.

Of interest are the last few entries. These are what you will often hear referred to as “property overrides”. Since these are the last entries in the CONFIGPATH, any value they set for a given component will “override” any declaration they set for the same component that was listed earlier in the CONFIGPATH. An example of this is the DirectJTDataSource.properties file. By default, this is jarr’ed up in the tomcatconfig.jar file under DAS. In the output above, you will see this fairly early in the CONFIGPATH Listing. The property file in question contained in this jar file includes an entry for ATGMySQLDS. This is why you will see a startup exception thrown regarding it not being bound if you don’t set a “real” value in a DirectJTDataSource.properties file later in the CONFIGPATH.

We set the following in our dynamo.env

atg.dynamo.data-dir=/opt/atg/ATG-Data/
atg.dynamo.server.name=MyServer

As such, there is a directory located at /opt/atg/ATG-Data/servers/MyServer/localconfig, in which we place a DirectJTDataSource.properties file with a datasource that actually exists in our atg-ds.xml configuration file.

Since it is the last entry in our CONFIGPATH as calculated by ATG, we can place a file in the subdirectory path as is in the default tomcatconfig.jar file and override earlier settings and customize our application. In other words, we create the following full path…

/opt/atg/ATG-Data/servers/MyServer/localconfig/atg/dynamo/service/jdbc/DirectJTDataSource.properties

…and place whatever contents we need in that file. This is what ATG will use for that component. We can also do this for any other component.

The order of precedence is as follows, with the first one listed being the one used if it exists:

  • atg.dynamo.data-dir/servers/servername/localconfig
  • servers/servername/localconfig in module directory
  • atg.dynamo.data-dir/localconfig
  • home/localconfig in module directory
  • module/config

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.