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 » Using Java PCF program on windows to connect AIX

Post new topic  Reply to topic
 Using Java PCF program on windows to connect AIX « View previous topic :: View next topic » 
Author Message
saadz
PostPosted: Thu Sep 28, 2006 7:18 am    Post subject: Using Java PCF program on windows to connect AIX Reply with quote

Newbie

Joined: 10 Apr 2006
Posts: 5

Hi Guys,

I am trying to run following program to get Queue Names. When I try to connect Windows Server it is working fine but when I run this program on Windows to connect to MQ on AIX box it's giving me an error. Please let me know if I need to define username/password somewhere?

Code:
import java.io.*;
import com.ibm.mq.*;
import com.ibm.mq.pcf.*;

/**
 * PCF example class showing use of PCFAgent and com.ibm.mq.pcf structure types
 * to generate and parse a PCF query. Note that the list of queue names returned
 * includes the dynamic queue used by the PCFAgent; the name of this queue is
 * accessible as the replyQueueName field of the PCFAgent object.
 *
 * @author Chris Markes
 */

public class ListQueueNames
{
   final public static String copyright = "Copyright (c) IBM Corp. 1998   All rights reserved.";

   public static void main (String [] args)
   {
      PCFAgent       agent;
      PCFParameter []    parameters =
               {
                  new MQCFST (CMQC.MQCA_Q_NAME, "*"),
                  new MQCFIN (CMQC.MQIA_Q_TYPE, CMQC.MQQT_ALL)
               };
      MQMessage []       responses;
      MQCFH          cfh;
      MQCFSL          cfsl;

      try
      {
         // Connect a PCFAgent to the specified queue manager

         if (args.length == 1)
         {
            System.out.print ("Connecting to local queue manager " +
               args [0] + "... ");
            agent = new PCFAgent (args [0]);
         }
         else
         {
            System.out.print ("Connecting to queue manager at " +
               args [0] + ":" + args [1] + " over channel " + args [2] + "... ");
            agent = new PCFAgent (args [0], Integer.parseInt (args [1]), args [2]);
         }

         System.out.println ("Connected.");

         // Use the agent to send the request

         System.out.print ("Sending PCF request... ");
         responses = agent.send (CMQCFC.MQCMD_INQUIRE_Q_NAMES, parameters);
         System.out.println ("Received reply.");
         cfh = new MQCFH (responses [0]);

         // Check the PCF header (MQCFH) in the first response message

         if (cfh.reason == 0)
         {
            System.out.println ("Queue names:");
            cfsl = new MQCFSL (responses [0]);

            for (int i = 0; i < cfsl.strings.length; i++)
            {
               System.out.println ("\t" + cfsl.strings [i]);
            }
         }
         else
         {
            System.out.println (cfh);

            // Walk through the returned parameters describing the error

            for (int i = 0; i < cfh.parameterCount; i++)
            {
               System.out.println (PCFParameter.nextParameter (responses [0]));
            }
         }

         // Disconnect

         System.out.print ("Disconnecting... ");
         agent.disconnect ();
         System.out.println ("Done.");
      }

      catch (ArrayIndexOutOfBoundsException abe)
      {
         System.out.println ("Usage: \n" +
            "\tjava ListQueueNames queue-manager\n" +
            "\tjava ListQueueNames host port channel");
      }

      catch (NumberFormatException nfe)
      {
         System.out.println ("Invalid port: " + args [1]);
         System.out.println ("Usage: \n" +
            "\tjava ListQueueNames queue-manager\n" +
            "\tjava ListQueueNames host port channel");
      }

      catch (MQException mqe)
      {
         System.err.println (mqe);
      }

      catch (IOException ioe)
      {
         System.err.println (ioe);
      }
   }
}


Error I am getting is as follows.

Code:
Sending PCF request... MQJE001: Completion Code 2, Reason 2033
com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2033


Thanks in advance.
SZ
Back to top
View user's profile Send private message
vennela
PostPosted: Thu Sep 28, 2006 7:42 am    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

How are you running this program
When you say,
Quote:
when I run this program on Windows to connect to MQ on AIX box
do you mean you are client connecting?
Can you explain a little more about the setup
Back to top
View user's profile Send private message Send e-mail Visit poster's website
saadz
PostPosted: Thu Sep 28, 2006 7:54 am    Post subject: Reply with quote

Newbie

Joined: 10 Apr 2006
Posts: 5

Yes, I am client connecting...
When I run this program on my PC (Windows 2000) to connect to MQ installed on Server (Windows 2000) it is working fine.
When I am trying to run this program on my PC (Windows 2000) to connect to MQ installed on IBM RISC machine (AIX) it is giving me an error.

Regards,
SZ
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Sep 28, 2006 8:38 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Maybe the AIX machine is not running a command server.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
saadz
PostPosted: Thu Sep 28, 2006 9:11 am    Post subject: Reply with quote

Newbie

Joined: 10 Apr 2006
Posts: 5

It is running command server, and another program of mine which uses MQQueueConnectionFactory and set username and password in it working fine with AIX box.

That's the reason I asked is there is any way to set username/password in this PCF class.

Thanks anyways.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Sep 28, 2006 12:22 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You can create an MQQueueManager object on your own and then create a PCFMessageAgent from that.

A 2033 error is not a security error, though.

It means that you didn't get a response back from the command server.

So that is why I suggested that the AIX machine is not running a command server.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
iceage
PostPosted: Thu Sep 28, 2006 12:53 pm    Post subject: Reply with quote

Acolyte

Joined: 12 Apr 2006
Posts: 68

If you can verify that command server is running on AIX , Look at the DLQ on your AIX server , messages might be going there because command server replies land up there due to authorization or other errors ..
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 » Using Java PCF program on windows to connect AIX
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.