Point-to-point Installation Verification Test (IVT)
Overview
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. This invocation method has the same prerequisites as the 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, IVTRun, 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 Turn tracing on (by default, tracing is off) qmgr Name of the queue manager to which you want to connect hostname Host on which the queue manager is running port TCP/IP port on which the queue manager's listener is running (default 1414) channel Client connection channel (default SYSTEM.DEF.SVRCONN) If the test completes successfully, 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
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 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 objectThis message means that either the server is not storing Java objects, or the permissions on the objects or the suffix are not correct.
Also, the following administered objects must be retrievable from a JNDI namespace:
A script, IVTSetup, is provided to create these objects automatically. Enter the command:
IVTSetupThe script invokes 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 script using the following command:
where:IVTRun [ -t ] -url "<providerURL>" [ -icf <initCtxFact> ]
- -t
- turns tracing on (by default, tracing is off)
- providerURL
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:
- Note:
- Enclose the providerURL string in quotation marks (").
"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.LdapCtxFactoryIf a file system service provider is used, set this parameter to:
com.sun.jndi.fscontext.RefFSContextFactoryIf 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 is provided for this purpose.
IVT error recovery
If the test is not successful, note the following:
- For help with any error messages involving the classpath, check that your classpath is set correctly.
- The IVT might fail with a message failed to create MQQueueManager, with an additional message including the number 2059. This indicates that WebSphere MQ failed to connect to the default local queue manager on the machine on which you ran the IVT. Check that the queue manager is running, and that it is marked as the default queue manager.
- A message failed to open MQ queue indicates that WebSphere MQ connected to the default queue manager, but could not open the SYSTEM.DEFAULT.LOCAL.QUEUE. This might indicate that either the queue does not exist on your default queue manager, or that the queue is not enabled for PUT and GET. Add or enable the queue for the duration of the test.
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
WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.
IBM is a trademark of the IBM Corporation in the United States, other countries, or both.