Deployment on Apache Tomcat Application Server

Extensibility
Extensibility covers the mechanisms by which you, as the user or developer, can extend the functionality of the Teradata Database, for example with the use of User Defined Functions, or UDFs.
Teradata Employee

Deployment on Apache Tomcat Application Server

  • Go to the [Tomcat Web Application Manager] – http://<your_server_name>:8080/manager/html

Figure 25:  Tomcat Web Application Manager

  • Click on the [Browse] button under [WAR file to deploy].
  • Browse for tomcat/terajmsa.war on local file system.

Figure 26: Browse to deploy the application

  • Click on the [Deploy] button.

Figure 27: After deployment

Logging

Standard Out log files are located in the following directory:

/Apache Software Foundation/Tomcat 6.0/logs

The log file name is stdout_[date].log.

User Setup

The current version of the JMS Administration tool cannot authenticate the login user through the Teradata Database in the Tomcat server.  This is because Tomcat does not have a userid/password authentication method in run time (it only allows data source authentication). In order to make sure that only authorized users can access the JMS Administration tool, we developed a quick solution by taking advantage of the J2EE Declarative Security.

The drawback of this solution is that the logout function does not really log out the user.  This is because Tomcat does not invalidate the login session. Unless you close the browser, you will not be asked to provide the user information when you access the JMS Administration tool.

In Tomcat, for example, if user defined "teradataJMSAUC" role in their configuration, only the user who belongs to the "teradataJMSAUC" role can login to JMS Administration tool.

You can setup "teradataJMSAUC" role by editing the [Tomcat]/conf/tomcat-users.xml.

For example, the following configuration allows a user “testuser” whose password is “secret” to login to the JMS Administration tool.

<tomcat-users>
...
<role rolename="teradataJMSAUC" />
<user username="testuser" password="secret" roles="teradataJMSAUC"/>
...
</tomcat-users>

Standalone JMS Resource Configuration

Integrated ActiveMQ

  • Copy the following jars from [ActiveMQ/lib] to [Tomcat/lib]
    • activemq-core-5.2.0.jar
    • commons-logging-1.1.jar
    • geronimo-j2ee-management_1.0_spec-1.0.jar
    • geronimo-jms_1.1_spec-1.1.1.jar
    • geronimo-jta_1.0.1B_spec-1.0.1.jar
  • Add jdbc default datasource to [Tomcat/conf/context.xml] between <Context> ... </Context>
    <Resource name="jdbc/com.teradata.terajmsa.MetaDS"
    auth="Container"
    type="javax.sql.DataSource"
    driverClassName="com.teradata.jdbc.TeraDriver"
    url="jdbc:teradata://[server name]/DATABASE=[database name],TMODE=ANSI,CHARSET=UTF8"
    username="[username]"
    password="[password]"
    maxActive="8"
    maxIdle="8"
    maxWait="-1" />

  • Add global resource link for JMS to [Tomcat/conf/context.xml] between <Context> ... </Context>
    <ResourceLink global="jms/ConnectionFactory" name="jms/ConnectionFactory" type="javax.jms.ConnectionFactory" />
    <ResourceLink global="jms/SampleTopic" name="jms/SampleTopic" type="javax.jms.Topic" />
    <ResourceLink global="jms/SampleQueue" name="jms/SampleQueue" type="javax.jms.Queue" />

  • Add resources for JMS to [Tomcat/conf/server.xml]
    <Resource
    name="jms/ConnectionFactory"
    auth="Container"
    type="org.apache.activemq.ActiveMQConnectionFactory"
    description="JMS Connection Factory"
    factory="org.apache.activemq.jndi.JNDIReferenceFactory"
    brokerURL="vm://localhost" brokerName="LocalActiveMQBroker"/>

    <Resource
    name="jms/SampleTopic"
    auth="Container"
    type="org.apache.activemq.command.ActiveMQTopic"
    description="my Topic"
    factory="org.apache.activemq.jndi.JNDIReferenceFactory"
    physicalName="SAMPLE.TOPIC"/>

    <Resource
    name="jms/SampleQueue"
    auth="Container"
    type="org.apache.activemq.command.ActiveMQQueue"
    description="my Queue"
    factory="org.apache.activemq.jndi.JNDIReferenceFactory"
    physicalName="SAMPLE.QUEUE"/>

Standalone ActiveMQ

  • Copy the following jars from [ActiveMQ/lib] to [Tomcat/lib]
    • activemq-core-5.2.0.jar
    • commons-logging-1.1.jar
    • geronimo-j2ee-management_1.0_spec-1.0.jar
    • geronimo-jms_1.1_spec-1.1.1.jar
    • geronimo-jta_1.0.1B_spec-1.0.1.jar
  • Add JDBC default datasource to [Tomcat/conf/context.xml] between <Context> ... </Context>
    <Resource name="jdbc/com.teradata.terajmsa.MetaDS"
    auth="Container"
    type="javax.sql.DataSource"
    driverClassName="com.teradata.jdbc.TeraDriver"
    url="jdbc:teradata://[server name]/DATABASE=[database name],TMODE=ANSI,CHARSET=UTF8"
    username="[username]"
    password="[password]"
    maxActive="8"
    maxIdle="8"
    maxWait="-1" />

  • Add resources for JMS to [Tomcat/conf/context.xml] between <Context> ... </Context>
    <Resource
    name="jms/RemoteConnectionFactory"
    auth="Container"
    type="org.apache.activemq.ActiveMQConnectionFactory"
    description="JMS Connection Factory"
    factory="org.apache.activemq.jndi.JNDIReferenceFactory"
    brokerURL="tcp://[server name]:61616" />

    <Resource
    name="jmsqueues/remoteTestQueue1"
    auth="Container"
    type="org.apache.activemq.command.ActiveMQQueue"
    description="testQueue1"
    factory="org.apache.activemq.jndi.JNDIReferenceFactory"
    physicalName="jmsqueues.testQueue1" />

  • Add resources for JMS to [ActiveMQ/conf/jndi.properties]
    java.naming.provider.url = tcp://[server name]:61616
    queue.jmsqueues.testQueue1 = jmsqueues.testQueue1

WebSphere MQ

  • Copy the following jars from [WebSphere MQ] to [Tomcat/lib]
    • com.ibm.mq.jar
    • com.ibm.mq.jmqi.jar
    • com.ibm.mqjms.jar
    • com.ibm.mq.pcf.jar
    • com.ibm.mq.soap.jar
    • com.ibm.mq.jms.Nojndi.jar
    • connector.jar
    • dhbcore.jar
    • fscontext.jar
    • jms.jar
    • jndi.jar
    • geronimo-j2ee-management_1.0_spec-1.0.jar
    • geronimo-jms_1.1_spec-1.1.1.jar
  • Add JDBC default datasource to [Tomcat/conf/context.xml] between <Context> ... </Context>
    <Resource
    name="jdbc/com.teradata.terajmsa.MetaDS"
    auth="Container"
    type="javax.sql.DataSource"
    driverClassName="com.teradata.jdbc.TeraDriver"
    url="jdbc:teradata://[server name]/DATABASE=[database name],TMODE=ANSI,CHARSET=UTF8"
    maxActive="8"
    maxIdle="8"
    maxWait="-1" />

  • Queue Setup: Add resources for JMS to [Tomcat/conf/context.xml] between <Context> ... </Context>
    <Resource
    name="jms/MyQCF"
    auth="Container"
    type="com.ibm.mq.jms.MQQueueConnectionFactory"
    factory="com.ibm.mq.jms.MQQueueConnectionFactoryFactory"
    HOST="[server name]"
    PORT="[port number]"
    CHAN="[channel name]"
    TRAN="1"
    QMGR="[queue manager name]"/>

    <Resource
    name="jms/MyQ"
    auth="Container"
    type="com.ibm.mq.jms.MQQueue"
    factory="com.ibm.mq.jms.MQQueueFactory"
    QU="[Physical queue name]"/>

  • Topic Setup: Add resources for JMS to [Tomcat/conf/context.xml] between <Context> ... </Context>
    <Resource
    name="jms/MyTCF"
    auth="Container"
    type="com.ibm.mq.jms.MQTopicConnectionFactory"
    factory="com.ibm.mq.jms.MQTopicConnectionFactoryFactory"
    username="[username]"
    password="[password]"
    HOST="[server name]"
    PORT="[port number]"
    CHAN="[channel name]"
    TRAN="1"
    QMGR="[queue manager name]" />

    <Resource
    name="jms/MyT"
    auth="Container"
    type="com.ibm.mq.jms.MQTopic"
    factory="com.ibm.mq.jms.MQTopicFactory"
    TOP="[Physical queue name]" />

  • Authentication Setup: We have tested the solution for the following 2 MQ authentications:
    1. The user account running the JMS Adapter is authorized to access WebSphere MQ.
    2. Specify an authorized MCA user in the server connection channel.