Setting up the JNDI

You must set up the JNDI environment before you can run the JMSHeader node sample. The necessary queues are created automatically by the sample. Complete the following steps to create the JNDI objects that are required to run the JMS Coordinated Request-Reply sample. Use the jms.defs file that is provided in the sample.

On Windows

Run the JNDI setup after importing, or importing and deploying the sample but before running the sample flow:

  1. Open the %MQInstallPath%\Java\bin\JMSAdmin.config file and ensure that the following name-value pairs are defined:
    INITIAL_CONTEXT_FACTORY=com.sun.jndi.fscontext.RefFSContextFactory
    PROVIDER_URL=file:/C:/JNDI-Directory
  2. Under C:\, create a folder named JNDI-Directory.
  3. Ensure that the jms.defs file that is provided with the sample contains the correct queue manager name and port number.
    1. In the Broker Development view, expand the JMS Header Node Message Flows project.
    2. Open the Other Resources directory and double-click jms.defs to open the file for editing.
    3. If you are using the default queue manager and port, QMANAGER must have a value of MB8BROKER and PORT must have a value of 2414. If you are using a different queue manager or port, edit the values for QMANAGER or PORT and save your changes.
  4. Run the following command:
    <mq_install_path>\Java\bin\JMSAdmin <  
    <toolkit_workspace_path>\JMSHeader Node Message Flows\jms.defs
    Note: On Windows you might need to enclose the command in quotes if there are spaces in the paths, see:
    C:\Program Files\IBM\MQSI\8.0>
    "C:\Program Files\IBM\WebSphere MQ\Java\bin\JMSAdmin" < 
    "C:\Documents and Settings\user_ID\IBM\wmbt80\workspace\JMSHeader 
    Node Message Flows\jms.defs"
    
  5. If any error messages are returned on the command line during the creation of the JNDI objects in the .bindings file, delete the .bindings file from the C:\JNDI-Directory and run the previous command again.

On UNIX

Run the JNDI setup before deploying the sample flow:

  1. Open the %MQInstallPath%/java/bin/JMSAdmin.config file and ensure that the following name-value pairs are defined:
    INITIAL_CONTEXT_FACTORY=com.sun.jndi.fscontext.RefFSContextFactory
    PROVIDER_URL=file:/home/username/JNDI-Directory
  2. Under /home/username, create a folder named JNDI-Directory.
  3. Copy the jms.defs file that is provided with the sample project JMSHeader Node Message Flows into the /home/username directory. Because of the spaces in the project folder name, you must use single quotation marks (') around the project folder name, for example, 'JMSHeader Node Message Flows'.
  4. Ensure that the jms.defs file that is provided with the sample contains the correct queue manager name and port number.
    1. In the Broker Development view, expand the JMS Header Node Message Flows project.
    2. Open the Other Resources directory and double-click jms.defs to open the file for editing.
    3. If you are using the default queue manager and port, QMANAGER must have a value of MB8BROKER and PORT must have a value of 2414. If you are using a different queue manager or port, edit the values for QMANAGER or PORT and save your changes.
  5. Run the following commands:
    1. cd %mqinstallpath%/java/bin
    2. . ./setjmsenv
    3. %MQInstallPath%/java/bin/JMSAdmin</home/username/JNDI-Directory/jms.defs
  6. If any errors occur during the creation of the JNDI objects in the .bindings file, delete the .bindings file from the /home/username/JNDI-Directory and run the previous command again.
  7. A sample broker archive (BAR) file (JMSCoordinatedRequestReplyUnix.bar) is provided with the sample, where the user name is db2admin.

On z/OS

Run the JNDI setup before deploying the sample flow:

  1. Open the %MQInstallPath%\Java\bin\JMSAdmin.config file and ensure that the following name-value pairs are defined:
    INITIAL_CONTEXT_FACTORY=com.sun.jndi.fscontext.RefFSContextFactory
    PROVIDER_URL=file:/home/username/JNDI-Directory
  2. Under /home/username, create a folder named ;JNDI-Directory.
  3. Copy the jms.defs file that is provided with the sample into the /home/username directory.
  4. Ensure that the jms.defs file that is provided with the sample contains the correct queue manager name and port number.
  5. Run the following command:
    %MQInstallPath%\Java\bin\JMSAdmin <
    /home/username/jms_zOS.defs
  6. In the jms_zOS.defs file, ensure that the transport type is named BINDINGS for z/OS.
  7. If any errors occur during the creation of the JNDI objects in the .bindings file, delete the .bindings file from the /home/username/JNDI-Directory and run the previous command again.
  8. A sample broker archive (BAR) file (JMSCoordinatedRequestReplyUnix.bar) is provided with the sample, where the user name is db2admin.

Back to Running the JMSHeader node sample

Back to sample home