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:
- 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
- Under C:\, create a folder named JNDI-Directory.
- Ensure that the jms.defs file that
is provided with the sample contains the correct queue manager name and port number.
- In the Broker Development view, expand the JMS Header Node Message Flows project.
- Open the Other Resources directory and double-click
jms.defs to open the file for editing.
- 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.
- 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"
- 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:
- 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
- Under /home/username,
create a folder named JNDI-Directory.
-
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'.
- Ensure that the jms.defs file that is provided with the sample contains
the correct queue manager name and port number.
- In the Broker Development view, expand the JMS Header Node Message Flows project.
- Open the Other Resources directory and double-click
jms.defs to open the file for editing.
- 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.
- Run the following commands:
cd %mqinstallpath%/java/bin
. ./setjmsenv
%MQInstallPath%/java/bin/JMSAdmin</home/username/JNDI-Directory/jms.defs
- 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.
- 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:
- 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
- Under /home/username, create a folder named
;JNDI-Directory.
- Copy the jms.defs file that is provided with the sample into the
/home/username directory.
- Ensure that the jms.defs file that is provided with the sample contains
the correct queue manager name and port number.
- Run the following command:
%MQInstallPath%\Java\bin\JMSAdmin <
/home/username/jms_zOS.defs
- In the jms_zOS.defs file,
ensure that the transport type is named BINDINGS for z/OS.
- 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.
- 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