Tomcat

Prerequisites

The following sections discuss prerequisites that must be performed before Stardust can be deployed within a Tomcat servlet engine.

Tomcat Download and Installation

Before any activities can be done, download Tomcat from the Apache Tomcat Site . Once downloaded, install TOMCAT by unpacking the ZIP/TAR file onto the host server. The Tomcat installation directory referred to as %TOMCAT_HOME% from this point forward.

A basic understanding of Tomcat Administration and Web Application Archive (WAR) files is required from this point forward.

JDBC Drivers

Copy JDBC drivers used to access the Stardust Audit Trail Database to the following directory, %TOMCAT_HOME%/common/lib

DataSource

You must define a datasource named AuditTrail.DataSource in the %TOMCAT_HOME%/conf/server.xml and use the following global naming resources configuration.

General Configuration

Create the datasource:

<?xml version='1.0' encoding='utf-8'?>
  <Server>
  ...
  <GlobalNamingResources>

  <!-- Stardust DATA SOURCE -->
    <Resource name="AuditTrail.DataSource" type="javax.sql.DataSource" 
      auth="Container"
      type="XA-Data-Source-Class"
      factory="DataSourceFactory-Class"
      maxActive="50"
      maxIdle="10"
      maxWait="5000"
      username="database-user-name"
      password="database-password"
      driverClassName="database-driver-fully-qualified-class-name"
      url="database-url"
      defaultAutoCommit="false" />

	

After creating the datasource as described in the section above, do the following:

  1. Copy the jdbc-driver and the log4j jar to %TOMCAT_HOME%/lib.
  2. Remove el-api.jar from the portals because it is already included in Tomcat.

Database Dependent Configuration Examples

The data source configuration depends on the kind of database you use:

Configuration Settings for MySQL

In case you use Tomcat on MySQL, the explicitUrl parameter has to be set to the value true.

Adjust the DataSource entry in the server.xml file:

<Resource name="AuditTrail.DataSource" auth="Container"
type="com.mysql.jdbc.jdbc2.optional.MysqlXADataSource"
factory="com.mysql.jdbc.jdbc2.optional.MysqlDataSourceFactory"
maxActive="50" maxIdle="10" maxWait="5000"
user="carnot" password="ag" defaultAutoCommit="false"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://host/dbname" explicitUrl="true" />

For information on the general setup of a MySQL audit trail database please refer to the chapter MySQL Audit Trail Database Setup.

Configuration Settings for Oracle

Adjust the DataSource entry in the server.xml file, e.g. for Oracle 11g:

<Resource name="AuditTrail.DataSource" auth="Container"
type="oracle.jdbc.xa.client.OracleXADataSource"
factory="oracle.jdbc.pool.OracleDataSourceFactory"
maxActive="50" maxIdle="10" maxWait="5000"
user="carnot" password="ag" defaultAutoCommit="false"
driverClassName="oracle.jdbc.OracleDriver"
url="jdbc:oracle:thin:@host:port:dbname"/>

For information on the general setup of an Oracle audit trail database please refer to the chapter Oracle Audit Trail Database Setup.

Configuration Settings for DB2

To setup the configuration for DB2:

At the db2 prompt, enter the following command to catalog the DB2 server node:

db2 catalog tcpip node <node_name> remote localhost server <db2 port number> remote_instance db2inst1

Now catalog the database:

db2 catalog database <database> as <db_name> at node <node_name> authentication server
db2 terminate

Test the connection:

db2 list node directory
db2 list database directory
db2 connect to <db_name> user <username> using <password>
db2 list tables
db2 connect reset

If you need to drop the database or instance alias:

db2 uncatalog database <db_name>
db2 uncatalog node <node_name>
db2 terminate

Adjust the DataSource entry in the server.xml file:

<Resource name="AuditTrail.DataSource" auth="Container"
type="com.ibm.db2.jcc.DB2XADataSource"
factory="com.ibm.db2.jcc.DB2DataSourceFactory"
maxActive="30" maxIdle="10" maxWait="5000"
user="carnot" password="ag" defaultAutoCommit="false"
driverClassName="com.ibm.db2.jcc.DB2Driver"
databaseName="<db_name>" />

For information on the general setup of a DB2 audit trail database please refer to the chapter DB2 Audit Trail Database Setup.

Predefined Deployment Configurations

Stardust provides predefined deployment configurations to prepare a deployment with Tomcat. You can achieve these Maven archetype templates matching your requirements by downloading from the Stardust artifactory. The following deployment configuration for Tomcat is provided to prepare a Stardust Portal WAR deployment for Tomcat 7:

To prepare a reporting WAR deployment for Tomcat 7, use the following archetype:

Refer to chapter Creating a Stardust Runtime Environment with Apache Maven in the Stardust Installation Guide for details.

Stardust provides predefined deployment configurations for Tomcat that can be used to prepare a Stardust Portal WAR deployment or a reporting WAR deployment. Please refer to our Stardust Knowledge Base for details on the currently provided archetypes and how to retrieve them.

Configuration Settings for MSSQL

You can define an XA datasource on Tomcat. Adjust the DataSource entry in Server.xml.

 <Resource name="AuditTrail.DataSource" 
              auth="Container"
              type="com.microsoft.sqlserver.jdbc.SQLServerXADataSource"
              factory="org.apache.naming.factory.BeanFactory"
              integratedSecurity="false"
              serverName="127.0.0.1"
              databaseName="carnot"
              portNumber="1433"
              user="carnot"
              password="ag" />

For information on the general setup of a MSSQL audit trail database please refer to the chapter MSSQL Audit Trail Database Setup.