Data Sources definition

Data Sources are defined in server.xml of your Tomcat server (in BASE_DIR/conf).

For local environment database connections make use of the thin client, which requires a username and a password. Since the password is changed every six months, this file is to be kept up to date. An up to date copy can be found Brian, Edit here.

Resource Links in tomcat are defined either globally for all applications or for each individual application in META-INF/context.xml.

Default Global Definition

Some of our web applications can be deployed for different experiments, their configuration being controlled via Maven Profiles. These profiles control configuration parameters such as database connections. To avoid having to list database connections for different experiments in the application's context.xml we decided to define a set of default ones globally.

Currently we have the following defined at the server level:

     <ResourceLink name="jdbc/config-srs"   type="javax.sql.DataSource" global="jdbc/config-prod" />
     <ResourceLink name="jdbc/config-exo"   type="javax.sql.DataSource" global="jdbc/config-prod" />
     <ResourceLink name="jdbc/config-fermi" type="javax.sql.DataSource" global="jdbc/glastgen" />

Similarly we have to define experiment specific connections for the DataCatalog and the Pipeline web applications:

     <ResourceLink name="jdbc/pipeline-ii-srs"          type="javax.sql.DataSource" global="jdbc/pipeline-ii-srs" />
     <ResourceLink name="jdbc/pipeline-ii-dev-srs"      type="javax.sql.DataSource" global="jdbc/pipeline-ii-dev-srs" />
     <ResourceLink name="jdbc/datacat-prod-srs"         type="javax.sql.DataSource" global="jdbc/datacat-prod-srs" />
     <ResourceLink name="jdbc/datacat-dev-srs"          type="javax.sql.DataSource" global="jdbc/datacat-test-srs" />
     <ResourceLink name="jdbc/pipeline-ii-fermi"        type="javax.sql.DataSource" global="jdbc/pipeline-ii-fermi" />
     <ResourceLink name="jdbc/pipeline-ii-dev-fermi"    type="javax.sql.DataSource" global="jdbc/pipeline-ii-dev-fermi" />
     <ResourceLink name="jdbc/pipeline-ii-test-fermi"   type="javax.sql.DataSource" global="jdbc/pipeline-ii-test-fermi" />

For web applications to work properly in your local environment you will have to copy the above resource links in context.xml of your local Tomcat installation.

Edit the file in TOMCAT_BASE/conf, where TOMCAT_BASE can be found in USER_HOME/.netbeans/NETBEANS_VERSION/apache-tomcat-VERSION_base.

  • No labels