ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » MQPUT1 MQException in Distribution List program

Post new topic  Reply to topic
 MQPUT1 MQException in Distribution List program « View previous topic :: View next topic » 
Author Message
RoyJacob
PostPosted: Tue Feb 26, 2002 12:27 am    Post subject: Reply with quote

Newbie

Joined: 26 Jan 2002
Posts: 2

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();

// Set the properties of the Individual dlitems.


IT1.queueManagerName = "QM";
IT1.queueName = "Q1";
IT2.queueManagerName = "QM" ;
IT2.queueName = "Q2" ;
IT3.queueManagerName = "QM" ;
IT3.queueName = "Q3" ;

// Populate the dlitems array with the individaual dlitems

dlitems[0] = IT1;
dlitems[1] = IT2;
dlitems[2] = IT3;

// 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() ;

}
catch (MQException ex)
{
System.out.println("An MQSeries error occurred : Completion code " +ex.completionCode + " Reason code " +

ex.reasonCode);
}
// Java buffer space error?
catch (java.io.IOException ex)
{
System.out.println("An error occurred whilst writing to the message buffer: " + ex);
}
}

}
Back to top
View user's profile Send private message
kolban
PostPosted: Tue Feb 26, 2002 7:21 am    Post subject: Reply with quote

Grand Master

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » MQPUT1 MQException in Distribution List program
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.