Running the point-to-point IVT

This section describes the point-to-point installation verification test program (IVT) that is supplied with WebSphere MQ JMS.

The IVT verifies the installation by connecting to the default queue manager on the local machine, using the WebSphere MQ JMS in bindings mode. It then sends a message to the SYSTEM.DEFAULT.LOCAL.QUEUE queue and reads it back again.

You can run the program in one of two possible modes.

With JNDI lookup of administered objects
JNDI mode forces the program to obtain its administered objects from a JNDI namespace, which is the expected operation of JMS client applications. (See Administering JMS objects for a description of administered objects). This invocation method has the same prerequisites as the administration tool (see Using the WebSphere MQ JMS administration tool).
Without JNDI lookup of administered objects
If you do not want to use JNDI, you can create the administered objects at runtime by running the IVT in non-JNDI mode. Because a JNDI-based repository is relatively complex to set up, run the IVT first without JNDI.

Point-to-point verification without JNDI

A script, named IVTRun on UNIX(R), or IVTRun.bat on Windows systems, is provided to run the IVT. This file is installed in the bin subdirectory of the installation.

To run the test without JNDI, issue the following command:

IVTRun [-t] -nojndi [-m <qmgr>]

For client mode, to run the test without JNDI, issue the following command:

IVTRun [-t] -nojndi -client -m <qmgr> -host <hostname> [-port <port>] 
              [-channel <channel>]

where:

-t
turns tracing on (by default, tracing is off)
qmgr
is the name of the queue manager to which you want to connect
hostname
is the host on which the queue manager is running
port
is the TCP/IP port on which the queue manager's listener is running (default 1414)
channel
is the client connection channel (default SYSTEM.DEF.SVRCONN)

If the test completes successfully, you should see output similar to the following:

5724-H72, 5655-L82, 5724-L26 (c) Copyright IBM Corp. 2002,2005. All Rights Reserved.
Websphere MQ classes for Java(tm) Message Service 6.0
Installation Verification Test


Creating a QueueConnectionFactory
Creating a Connection
Creating a Session
Creating a Queue
Creating a QueueSender
Creating a QueueReceiver
Creating a TextMessage
Sending the message to SYSTEM.DEFAULT.LOCAL.QUEUE
Reading the message back again

Got message:
JMS Message class: jms_text
  JMSType:         null
  JMSDeliveryMode: 2
  JMSExpiration:   0
  JMSPriority:     4
  JMSMessageID:    ID:414d5120514d5f63616c6c616e6169734286ac4120000a02
  JMSTimestamp:    1101826963911
  JMSCorrelationID:null
  JMSDestination:  queue:///SYSTEM.DEFAULT.LOCAL.QUEUE
  JMSReplyTo:      null
  JMSRedelivered:  false
  JMS_IBM_PutDate:20041130
  JMSXAppID:WebSphere MQ Client for Java
  JMS_IBM_Format:MQSTR
  JMS_IBM_PutApplType:28
  JMS_IBM_MsgType:8
  JMSXUserID:mwhite
  JMS_IBM_PutTime:15024393
  JMSXDeliveryCount:1
A simple text message from the MQJMSIVT program
Reply string equals original string
Closing QueueReceiver
Closing QueueSender
Closing Session
Closing Connection
IVT completed OK
IVT finished

Point-to-point verification with JNDI

To run the IVT with JNDI, the LDAP server must be running and must be configured to accept Java(TM) objects. If the following message occurs, it indicates that there is a connection to the LDAP server, but that the server is not correctly configured:

Unable to bind to object

This message means that either the server is not storing Java objects, or the permissions on the objects or the suffix are not correct. For more help in this situation, see the documentation for your LDAP server.

Also, the following administered objects must be retrievable from a JNDI namespace:

A script, named IVTSetup on UNIX, or IVTSetup.bat on Windows systems, is provided to create these objects automatically. Enter the command:

IVTSetup

The script invokes the WebSphere MQ JMS Administration tool (see Using the WebSphere MQ JMS administration tool) and creates the objects in a JNDI namespace.

The MQQueueConnectionFactory is bound under the name ivtQCF (for LDAP, cn=ivtQCF). All the properties are default values:

TRANSPORT(BIND)
PORT(1414)
HOSTNAME(localhost)
CHANNEL(SYSTEM.DEF.SVRCONN)
VERSION(1)
CCSID(819)
TEMPMODEL(SYSTEM.DEFAULT.MODEL.QUEUE)
QMANAGER()

The MQQueue is bound under the name ivtQ (cn=ivtQ). The value of the QUEUE property becomes QUEUE(SYSTEM.DEFAULT.LOCAL.QUEUE). All other properties have default values:

PERSISTENCE(APP)
QUEUE(SYSTEM.DEFAULT.LOCAL.QUEUE)
EXPIRY(APP)
TARGCLIENT(JMS)
ENCODING(NATIVE)
VERSION(1)
CCSID(1208)
PRIORITY(APP)
QMANAGER()

Once the administered objects are created in the JNDI namespace, run the IVTRun (IVTRun.bat on Windows systems) script using the following command:

IVTRun [ -t ]  -url "<providerURL>" [ -icf <initCtxFact> ]

where:

-t
turns tracing on (by default, tracing is off)
providerURL
Note:
Enclose the providerURL string in quotation marks (").
This is the JNDI location of the administered objects. If the default initial context factory is in use, this is an LDAP URL of the form:
"ldap://hostname.company.com/contextName"

If a file system service provider is used, (see initCtxFact below), the URL is of the form:

"file://directorySpec"
initCtxFact
is the classname of the initial context factory. The default is for an LDAP service provider, and has the value:
com.sun.jndi.ldap.LdapCtxFactory

If a file system service provider is used, set this parameter to:

com.sun.jndi.fscontext.RefFSContextFactory

If the test completes successfully, the output is similar to the non-JNDI output, except that the create QueueConnectionFactory and Queue lines indicate retrieval of the object from JNDI. The following shows an example.

5724-H72, 5655-L82, 5724-L26 (c) Copyright IBM Corp. 2002,2005. All Rights Reserved.
Websphere MQ classes for Java(tm) Message Service 6.0
Installation Verification Test

Using administered objects, please ensure that these are available

Retrieving a QueueConnectionFactory from JNDI
Creating a Connection
Creating a Session
Retrieving a Queue from JNDI
Creating a QueueSender
Creating a QueueReceiver
Creating a TextMessage
Sending the message to SYSTEM.DEFAULT.LOCAL.QUEUE
Reading the message back again

Got message:
JMS Message class: jms_text
  JMSType:         null
 ...
 ...

Although not strictly necessary, it is good practice to remove objects that are created by the IVTSetup script from the JNDI namespace. A script called IVTTidy (IVTTidy.bat on Windows systems) is provided for this purpose.

IVT error recovery

If the test is not successful, note the following:

The IVT tests whether the following Java archive (JAR) files are accessible to your Java virtual machine (JVM):