I get the following exception when I execute a Java code which implements Distribution List ..Could anyone please suggest a solution
Unable to load message catalog - mqji
MQPUT1 MQException: com.ibm.mqbind.MQInternalException
Exception in thread "main" java.lang.NullPointerException
at com.ibm.mqbind.MQPutMessageOptions.readFrom(MQPutMessageOptions.java:
304)
at com.ibm.mq.MQSESSIONServer.MQPUT(MQSESSIONServer.java:288)
at com.ibm.mq.MQDistributionList.put(MQDistributionList.java:251)
at Dist.main(Dist.java:4
Java code is as below :
import com.ibm.mq.*; // Include the MQSeries classes for Java package
public class Dist
{
public static void main(String args[])
{
try {
MQQueueManager qMgr = new MQQueueManager("QM"); // Create a connection to the queue manager TEST
int openOptions = MQC.MQOO_OUTPUT ;
String userId = "db2admin" ;
// Create an array of MQDistributionListItem objects. Size of the array is determined by the
// number of destination queues.
MQDistributionListItem[] dlitems = new MQDistributionListItem[3];
// Create the individual dlitems of the distribution list
MQDistributionListItem IT1 = new MQDistributionListItem();
MQDistributionListItem IT2 = new MQDistributionListItem();
MQDistributionListItem IT3 = new MQDistributionListItem();
// Create a DistributionList object with the dlitems.
MQDistributionList MyDistribution = new MQDistributionList(qMgr,dlitems,openOptions, userId);
MQMessage MyMesg = new MQMessage();
MyMesg.writeUTF("Test Data ");
MQPutMessageOptions pmo = new MQPutMessageOptions();
MyDistribution.put(MyMesg, pmo); // Send message to the distribution list.
qMgr.commit();
MyDistribution.close();
qMgr.disconnect() ;
Joined: 22 May 2001 Posts: 1072 Location: Fort Worth, TX, USA
Urgh ... I don't like internal errors. They can be quickly solved but it takes a little skills. Can you switch on MQSeries/Java trace? Rerun the program and capture the output and post here? From the trace, we will see the actual underlying base MQ calls and be able to track the results.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum