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 API Support » AMI Session Open Fails with weird RC2 code

Post new topic  Reply to topic
 AMI Session Open Fails with weird RC2 code « View previous topic :: View next topic » 
Author Message
spidie
PostPosted: Mon May 06, 2002 11:39 pm    Post subject: Reply with quote

Newbie

Joined: 06 May 2002
Posts: 2

Hi Everyone - my first post here!

I'm just starting out using the AMI (C++ interface) on our Solaris machine running MQSeries 5.2. I'm already used the MQI and the C++ Interface on this machine with the same queues and had no problems.

Anyway - I have created a repository file and written a simple test application that puts to a queue and receives the response (the reply queue is set to just echo the request queue for test purposes).

The application runs but hangs in the exception handler when I try to access the AmStatus object. I have enabled tracing and can see in the trace that the following error occurs:

Code:

   !(00001) <<< --- AMT C++ Exception details -------- >>>
   !(00001)   >>> class :AmSession
   !(00001)   >>> method:open
   !(00001)   >>> text  :amSesOpen failed
   !(00001)   >>> CC    :2
   !(00001)   >>> RC    :49
   !(00001) <<< -------------------------------------- >>>


Later on in the trace I can see that the RC2 code has been set to 6000 - but I find no mention of this error code in the mq header files or any of the documentation.

I'm puzzled. I've checked that it is retrieving the QM and queue names correctly and I can see that this is all fine from the trace....so I don't know where to go next!

Any help much appreciated.

Steve
Back to top
View user's profile Send private message
spidie
PostPosted: Mon May 06, 2002 11:41 pm    Post subject: Reply with quote

Newbie

Joined: 06 May 2002
Posts: 2

ps. Here is the full code from my test app....
Code:

#include <string>
#include <iostream.h>
#include <amtcpp.hpp>

using namespace std;

int main( int argc, char * argv[] )
{
   AmSessionFactory*    pSessionFactory   = NULL;
   AmSession*          pSession          = NULL;
   AmSender*          pSender           = NULL;
   AmReceiver*          pReceiver         = NULL;
   AmMessage*          pSendMsg          = NULL;
   AmMessage*          pReceiveMsg       = NULL;
   AmPolicy*         pPolicy           = NULL;

   pSessionFactory = new AmSessionFactory();
   pSession =  pSessionFactory->createSession("EMA.SESSION");
   pPolicy = pSession->createPolicy("EMA.POLICY");
   
   pSender = pSession->createSender("EMA.REQUEST");
   pReceiver = pSession->createReceiver("EMA.REPLY");

   pSendMsg = pSession->createMessage("EMA.SEND.MESSAGE");
   pReceiveMsg = pSession->createMessage("EMA.RECEIVE.MESSAGE");

   try
   {
      pSession->open(*pPolicy);
      pSender->open(*pPolicy);
      pReceiver->open(*pPolicy);

     AmBytes *dataSent = new AmBytes((const char*)"An AMI Test message");
      pSendMsg->writeBytes(*dataSent);
     pSender->send(*pSendMsg);

      pReceiver->receive(*pReceiveMsg);
      AmBytes data = pReceiveMsg->readBytes(pReceiveMsg->getDataLength());

     cout << "Text received: " << data.dataPtr();
   }
   catch(AmException& e)
   {
      AmObject * source = e.getSource();
      if (source != NULL)
      {
         AmStatus status = source->getLastErrorStatus();
         cerr << "Object in error; name = " << source->getName().text() << endl;
         cerr << "and reasonCode2 = " << status.getReasonCode2() << endl;
         cerr << "Object in error; RC = " << status.getReasonCode() << endl;
      }
      source->clearErrorCodes();
      exit(1);
   }

   // Cleanup
   pSession->deleteMessage(&pReceiveMsg);
   pSession->deleteMessage(&pSendMsg);
   pSession->deleteReceiver(&pReceiver);
   pSession->deleteSender(&pSender);
   pSession->deletePolicy(&pPolicy);
   pSessionFactory->deleteSession(&pSession);
   delete pSessionFactory;

}

Back to top
View user's profile Send private message
apowell
PostPosted: Tue May 07, 2002 1:36 am    Post subject: Reply with quote

Newbie

Joined: 01 Oct 2001
Posts: 3

Steve

The RC = 49 means AMRC_TRANSPORT_ERR which means that, in this case, the MQCONN has failed for some reason. The RC2 is the return code from MQ but I don't know what the 6000 means as it isn't valid.
Assuming your queue manager is defined then check that the initialization section of your policy and the amthosts.xml are correct.

Good luck
Back to top
View user's profile Send private message
Newtier
PostPosted: Thu Jun 20, 2002 10:21 am    Post subject: same problem as yours Reply with quote

Newbie

Joined: 14 Mar 2002
Posts: 3

We get the same error you are getting. In this case, it is sporadic. We can use the same code, copy the amt.xml and amthosts file and create the same MQSeries objects (QM and Q) on different machines. On one machine it will work and another it will fail.

It even fails with the IBM supplied sample C programs. We've verified the "quick hit" issues, such as making sure the underlying objects exist and are defined properly.

In fact we were looking here hoping someone else found a more obscure solution.

Any more detailed suggestions would be appreciated.
Back to top
View user's profile Send private message
crgharm
PostPosted: Wed Jul 10, 2002 7:38 am    Post subject: Same problem with Cobol sample AMTVOFSN Reply with quote

Novice

Joined: 25 Apr 2002
Posts: 21
Location: St. Louis, Missouri

We receive the same error running the IBM supplied sample program AMTVOFSN. Have verified object names and can access objects via MQI.
Currently stumped!
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 API Support » AMI Session Open Fails with weird RC2 code
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.