Author |
Message
|
ivanachukapawn |
Posted: Tue Nov 22, 2005 9:33 am Post subject: MQOD cannot be supplied to MQDistributionList - MQ 2154 err |
|
|
 Knight
Joined: 27 Oct 2003 Posts: 561
|
The 2154 error description contains the following:
Corrective action: If it is intended to open a distribution list, set the ObjectType field to MQOT_Q and RecsPresent to the number of destinations in the list. If it is not intended to open a distribution list, set the RecsPresent field to zero.
However, I do not see any way to specify an MQOD to the constructors or methods of either MQDistributionList or MQDistributionListItem
Does anybody see a way to specify the MQOD ObjectType and MQOD RecsPresents fields to the MQDistributionList methods?
Incidentally, I did extensive searches on MQSERIES.NET for answers to this question but did not find an answer. |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Nov 22, 2005 9:36 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
What language, please? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
ivanachukapawn |
Posted: Tue Nov 22, 2005 9:55 am Post subject: |
|
|
 Knight
Joined: 27 Oct 2003 Posts: 561
|
Brandon,
MQDistributionList, MQDistributionListItem are both Java classes.
MQQueueManager class has a method accessDistributionList which is receiving the 2154 error code.
The language is Java.
Code: |
MQDistributionListItem [] litems = new MQDistributionListItem [1000];
int dliIndex = 0;
for (Iterator iterator = queues.iterator(); iterator.hasNext();)
{
String qname = (String) iterator.next();
MQDistributionListItem dli = new MQDistributionListItem ();
dli.queueName = qname;
dli.queueManagerName = qmgrName;
litems [dliIndex] = dli;
System.out.println("just set up " + dli.queueName + " MQDistributionListItem in array");
dliIndex++;
}
/**
* NOW, create the MQDistributionList
*/
MQDistributionList distributionList = null;
try
{
distributionList = qmgr.accessDistributionList
(
litems,
openOption
);
}
catch (MQException e)
{
System.out.println("SOME PROBLEM GETTING A DISTRIBUTION LIST FROM THE QUEUE MANAGER");
e.printStackTrace(); //To change body of catch statement use Options | File Templates.
}
|
|
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Nov 22, 2005 10:10 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
ivanachukapawn wrote: |
Brandon, |
who?
ivanachukapawn wrote: |
MQDistributionList, MQDistributionListItem are both Java classes. |
The Java MQ API shares a lot in common with the .NET MQ API. I don't know the .NET API off the top of my head well enough to know if it's got Distribution List objects in it or not.
Regardless, it is always more polite to indicate the language you are using, when asking questions about code.
ivanachukapawn wrote: |
MQQueueManager class has a method accessDistributionList which is receiving the 2154 error code.
The language is Java.
Code: |
MQDistributionListItem [] litems = new MQDistributionListItem [1000];
int dliIndex = 0;
for (Iterator iterator = queues.iterator(); iterator.hasNext();)
{
String qname = (String) iterator.next();
MQDistributionListItem dli = new MQDistributionListItem ();
dli.queueName = qname;
dli.queueManagerName = qmgrName;
litems [dliIndex] = dli;
System.out.println("just set up " + dli.queueName + " MQDistributionListItem in array"); |
|
It might be worth adding a dump of the MQDistributionListItem.reasonCode and .completionCode properties here, just to make sure.
It would also be good to iterate over the MQDistributionListItems during your exception handling , and report the individual reasonCode/completionCodes as well. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
ivanachukapawn |
Posted: Tue Nov 22, 2005 10:16 am Post subject: |
|
|
 Knight
Joined: 27 Oct 2003 Posts: 561
|
Jeff,
I apologize for getting your name wrong in the first post, and for being impolite by not specifying the language as Java.
I will implement your suggestions about processing and displaying the individual return fields for the items in the MQDistributionListItem array.
However, I am still at a loss as to how it might be possible to specify MQOD object to the MQDistributionList, MQDistributionListItem, or MQQueueManager.accessDistributionList methods. Any ideas on this? |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Nov 22, 2005 10:22 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
ivanachukapawn wrote: |
However, I am still at a loss as to how it might be possible to specify MQOD object to the MQDistributionList, MQDistributionListItem, or MQQueueManager.accessDistributionList methods. Any ideas on this? |
Not yet... The thing is that the MQOD should be completely wrapped in the oo-interface. So it's a question of finding the right way to use the OO interface.
The only thing that pops into my head is that, rather than using accessDistributionList, try using the MQDistributionList constructor and see if you get a different result.
It may also be that you've stumbled into a bug in the classes you are using.
What version of MQ are you running? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
JT |
Posted: Tue Nov 22, 2005 10:23 am Post subject: |
|
|
Padawan
Joined: 27 Mar 2003 Posts: 1564 Location: Hartford, CT.
|
|
Back to top |
|
 |
ivanachukapawn |
Posted: Tue Nov 22, 2005 10:24 am Post subject: |
|
|
 Knight
Joined: 27 Oct 2003 Posts: 561
|
Its MQ5.3. I'll try the MQDistributionList constructor (instead of the accessDistributionList method) and see if I get any different results. |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Nov 22, 2005 10:25 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
What fixpack level of v5.3? And are you using MA88, or the supplied Java API with your fixpack level of 5.3? (you should be using the later, assuming it's included in your CSD/FP level). _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
ivanachukapawn |
Posted: Tue Nov 22, 2005 10:26 am Post subject: |
|
|
 Knight
Joined: 27 Oct 2003 Posts: 561
|
I'm not using MQPut1. I'm using the MQDistributionList put () method. However, this is not the problem in that I don't even get to that code. The 2154 is encountered when attempting MQQueueManager's accessDistributionList method. |
|
Back to top |
|
 |
ivanachukapawn |
Posted: Tue Nov 22, 2005 10:28 am Post subject: |
|
|
 Knight
Joined: 27 Oct 2003 Posts: 561
|
Jeff,
I initially replied incorrectly to your question about MQ version (I forgot I upgraded last Friday).
I'm running MQ6.0. |
|
Back to top |
|
 |
ivanachukapawn |
Posted: Tue Nov 22, 2005 10:37 am Post subject: |
|
|
 Knight
Joined: 27 Oct 2003 Posts: 561
|
Jeff,
I ran a new version of the code which uses the MQDistributionList constructor instead of MQQueueManager's accessDistributionList method. The results were identical.
JD |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Nov 22, 2005 10:37 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
|
Back to top |
|
 |
ivanachukapawn |
Posted: Tue Nov 22, 2005 10:53 am Post subject: |
|
|
 Knight
Joined: 27 Oct 2003 Posts: 561
|
Jeff,
Thats terrific! I am using the MQ Java API Client Connection (from an XP Professional Laptop running MQ 6.0). This is undoubtedly the problem, so I guess I will have to get a hold of Refresh Pack 6.0.1.0
Thanks a lot for your willingness to help me with this problem.
Sincerely,
John Davis |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Nov 22, 2005 10:56 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
It *might* not be the problem.
The Java client API is 100% pure java, so it doesn't link against the mqic lib file that the apar is talking about.
But you can see if your same code doesn't throw the error using a server binding and see what happens. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|