This section describes the point-to-point installation verification test program (IVT) that is supplied with WebSphere MQ JMS.
The IVT attempts to verify 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.
A script, named IVTRun on UNIX, or IVTRun.bat on Windows NT, 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:
If the test completes successfully, you should see output similar to the following:
5648-C60, 5724-B41, 5655-F10 (c) Copyright IBM Corp. 2002. All Rights Reserved. Websphere MQ classes for Java(tm) Message Service 5.300 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:414d51204153434152492020202020207cce883c03300020 JMSTimestamp: 1016124013892 JMSCorrelationID:null JMSDestination: queue:///SYSTEM.DEFAULT.LOCAL.QUEUE JMSReplyTo: null JMSRedelivered: false JMS_IBM_PutDate:20020314 JMSXAppID:java JMS_IBM_Format:MQSTR JMS_IBM_PutApplType:6 JMS_IBM_MsgType:8 JMSXUserID:parkiw JMS_IBM_PutTime:16401390 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
To run the IVT with JNDI, the LDAP server must be running and must be configured to accept Java objects. If the following message occurs, it indicates that there is a connection to the LDAP server, but 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. See Checking your LDAP server configuration.
Also, the following administered objects must be retrievable from a JNDI namespace:
A script, named IVTSetup on UNIX, or IVTSetup.bat on Windows NT, is provided to create these objects automatically. Enter the command:
IVTSetup
The script invokes the WebSphere MQ JMS Administration tool (see Chapter 5, 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 NT) script using the following command:
IVTRun [ -t ] -url "<providerURL>" [ -icf <initCtxFact> ]where:
ldap://hostname.company.com/contextName
If a file system service provider is used, (see initCtxFact below), the URL is of the form:
file://directorySpec
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.
5648-C60, 5724-B41, 5655-F10 (c) Copyright IBM Corp. 2002. All Rights Reserved. Websphere MQ classes for Java(tm) Message Service 5.300 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 NT) is provided for this purpose.
If the test is not successful, the following notes may be helpful:
Table 6 lists the classes that are tested by IVT, and the package
that they come from:
Table 6. Classes that are tested by IVT
Class | Jar file |
---|---|
WebSphere MQ JMS classes | com.ibm.mqjms.jar |
com.ibm.mq.MQMessage | com.ibm.mq.jar |
javax.jms.Message | jms.jar |
javax.naming.InitialContext | jndi.jar |
javax.resource.cci.Connection | connector.jar |
javax.transaction.xa.XAException | jta.jar |
com/sun/jndi/toolkit/ComponentDirContext | providerutil.jar |
com.sun.jndi.ldap.LdapCtxFactory | ldap.jar |