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 » General Discussion » MQOD cannot be supplied to MQDistributionList - MQ 2154 err

Post new topic  Reply to topic Goto page Previous  1, 2
 MQOD cannot be supplied to MQDistributionList - MQ 2154 err « View previous topic :: View next topic » 
Author Message
wschutz
PostPosted: Tue Nov 22, 2005 11:19 am    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

I'd go with Jeff's suggestion to create an MQDistributionList object instead of using the qmgr's. method....
_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
ivanachukapawn
PostPosted: Tue Nov 22, 2005 11:21 am    Post subject: Reply with quote

Knight

Joined: 27 Oct 2003
Posts: 561

wshutz

I already tried that constructor. It didn't make any difference.

JD
Back to top
View user's profile Send private message
wschutz
PostPosted: Tue Nov 22, 2005 11:50 am    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

Okay, I did a quick test here (Linux and 6.0.1 qmgr) and both methods
work fine as both client and server bindings .....
_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
wschutz
PostPosted: Thu Nov 24, 2005 3:37 am    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

For future reference, here's the code that works on my machine:
Code:

import com.ibm.mq.*; //Include the WebSphere MQ classes for Java package

public class MQSample {
    // define the name of the QueueManager
    private static final String qManager = "WSCHUTZ";
    // main method: simply call the runSample() meth
    public static void main(String args[]) {
        new MQSample().runSample();
    }

    public void runSample() {

        try {
            MQEnvironment.hostname="localhost";
            MQEnvironment.channel = "SYSTEM.DEF.SVRCONN";
            MQEnvironment.port = 1414;
            // Create a connection to the QueueManager
            System.out.println("Connecting to queue manager: "+qManager);
            MQQueueManager qMgr = new MQQueueManager(qManager);


            MQDistributionListItem[] dil = new MQDistributionListItem[2];
            MQDistributionListItem li1 = new MQDistributionListItem();
            li1.queueName = "TEST.1";
            dil[0] = li1;
            MQDistributionListItem li2 = new MQDistributionListItem();
            li2.queueName = "TEST.2";
            dil[1] = li2;

            // Set up the options on the queue we wish to open
            int openOptions = MQC.MQOO_OUTPUT;
            MQDistributionList dl = qMgr.accessDistributionList( dil, openOptions);

            // Define a simple WebSphere MQ Message ...
            MQMessage msg = new MQMessage();
            // ... and write some text in UTF8 format
            msg.writeString("Hello, World!");

            // Specify the default put message options
            MQPutMessageOptions pmo = new MQPutMessageOptions();

            // Put the message to the queue
            System.out.println("Sending a message...");
            dl.put(msg, pmo);

            MQDistributionList d2 = qMgr.accessDistributionList( dil , openOptions );
            System.out.println("Sending a message...");
            msg.writeString("and Hello, Mars!");
            d2.put(msg, pmo);


            // Disconnect from the QueueManager
            System.out.println("Disconnecting from the Queue Manager");
            qMgr.disconnect();
            System.out.println("Done!");
        }
        catch (MQException ex) {
            System.out.println("A WebSphere MQ Error occured : Completion Code "
                    + ex.completionCode + " Reason Code " + ex.reasonCode);
        }
        catch (java.io.IOException ex) {
            System.out.println("An IOException occured whilst writing to the message buffer: "
                    + ex);
        }
    }
}


_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
RogerLacroix
PostPosted: Thu Nov 24, 2005 10:16 pm    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3264
Location: London, ON Canada

wschutz wrote:
Code:
new MQSample().runSample();

Looks like someone is using the lastest release of Eclispe.

Wayne, can I post your code on my web site?

Regards,
Roger Lacroix
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
wschutz
PostPosted: Fri Nov 25, 2005 4:53 am    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

Sure Roger, feel free....
_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
Display posts from previous:   
Post new topic  Reply to topic Goto page Previous  1, 2 Page 2 of 2

MQSeries.net Forum Index » General Discussion » MQOD cannot be supplied to MQDistributionList - MQ 2154 err
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.