Configuring the Example MDB


You must make the following configuration changes to the WebLogic Server 7.0 to drive the example MDB using TIBCO Enterprise Message Service instead of WebLogic Server.

These steps are described below.

Adding TIBCO Enterprise Message Service to the WebLogic Server CLASSPATH

The WebLogic Server 7.0 environment setup and startup scripts check for the existence of the environment variable EXT_PRE_CLASSPATH and a file named extEnv.cmd. If the variable exists, WebLogic Server prepends its value to the CLASSPATH. If the extEnv.cmd file exists, it is called when WebLogic Server starts. To add TIBCO Enterprise Message Service to the WLS 7.0 CLASSPATH:

  1. Create a file named extEnv.cmd that contains the following line:
  2.  
       set EXT_PRE_CLASSPATH=C:\Tibco\ems\clients\java\tibjms.jar 
    
  3. Save the file to the following location:
  4.  
       C:\bea\weblogic700\samples\server\config\examples 
    

Modifying the MDB Deployment Descriptor for TIBCO Enterprise Message Service

The source files for the example MDB deployment descriptor are found in the example MDB source directory. Modify the file named weblogic-ejb-jar.xml. The following lines must be inserted (in two separate places) inside the <message-driven-descriptor> tag:

 
<initial-context-factory>  
      com.tibco.tibjms.naming.TibjmsInitialContextFactory  
</initial-context-factory> 
<provider-url> 
      tibjmsnaming://localhost:7222  
</provider-url>  
<connection-factory-jndi-name> 
      TopicConnectionFactory  
</connection-factory-jndi-name> 

Modifying the Client Program to Use TIBCO Enterprise Message Service JNDI

To use the JNDI provided by TIBCO Enterprise Message Service, the example MDB client program must be modified in three areas: the source code, the build script, and the runtime environment (that is, the CLASSPATH).

To modify the client source code:

The source file for the MDB client program is Client.java. Find and replace the following strings in the source file:

Find:
Replace With:
weblogic.jms.ConnectionFactory
TopicConnectionFactory
weblogic.jndi.WLInitialContextFactory
com.tibco.tibjms.naming.TibjmsInitialContextFactory

There should be one occurrence of each of the above strings. When you are finished, save your changes.

To modify the build script to run the client:

The client program is run by executing the ant build script with a target of run. The build script passes the JNDI provider URL to the client program, and therefore it must be modified to pass the provider URL of TIBCO Enterprise Message Service.

The file build.xml in the example MDB source directory contains the build script. Near the bottom of that file is the following line:

 
<arg value="t3://localhost:${PORT}"/> 

Modify that line as follows:

 
<arg value="tibjmsnaming://localhost:7222" /> 
To set the environment:

You have already specified that tibjms.jar should be added to the CLASSPATH by creating a new command file in a previous section. To set the environment, perform the following:

  1. Open a new command prompt window
  2. Change directory to:
  3.  
       C:\bea\weblogic700\samples\server\config\examples> 
    
  4. Enter the following command:
  5.  
    > setExamplesEnv 
    

Verify that tibjms.jar is present when the script echoes the CLASSPATH.

Creating the Example MDB Destination Object Inside TIBCO EMS

To create the example MDB destination objects, perform the following:

  1. Start the TIBCO Enterprise Message Service server by selecting Start->Programs->TIBCO Enterprise Message Service 4.3->Start JMS Server from the Windows Start menu.
  2. Start the TIBCO Enterprise Message Service administration tool by selecting Start->Programs->TIBCO Enterprise Message Service 4.3->Start EMS Administration Tool from the Windows Start menu.
  3. Enter the following commands:
  4.  
       > connect 
       > create topic quotes 
    

TIBCO Enterprise Message Service™ Application Integration Guide
Software Release 4.3, February 2006
Copyright © TIBCO Software Inc. All rights reserved
www.tibco.com