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 » Unable to connect to Websphere MQ Manager using XMS

Post new topic  Reply to topic
 Unable to connect to Websphere MQ Manager using XMS « View previous topic :: View next topic » 
Author Message
snawaz
PostPosted: Tue May 27, 2014 2:47 am    Post subject: Unable to connect to Websphere MQ Manager using XMS Reply with quote

Newbie

Joined: 27 May 2014
Posts: 1

This code reproduces the issue:


Code:
    #include <iostream>
    #include <xms.hpp>
   
    int main()
    {
        try
        {
            xms::ConnectionFactory factory;
   
            factory.setIntProperty(XMSC_CONNECTION_TYPE,      XMSC_CT_WMQ);
            factory.setIntProperty(XMSC_WMQ_CONNECTION_MODE,  XMSC_WMQ_CM_CLIENT);
            factory.setStringProperty(XMSC_WMQ_QUEUE_MANAGER, "devpmmq.queue.manager");
            factory.setStringProperty(XMSC_WMQ_HOST_NAME,     "devpmmq");
            factory.setStringProperty(XMSC_WMQ_CHANNEL,       "SYSTEM.DEF.SVRCONN");
            factory.setIntProperty(XMSC_WMQ_PORT,              1414);
   
             std::cout << "Is Factory Null? => " << factory.isNull() << std::endl;
             xms::Connection conn = factory.createConnection(); //THIS THROWS EXCEPTION
             std::cout << "Is Factory Null? => " << factory.isNull() << std::endl;
        }
        catch(xms::Exception const & e)
        {
             e.dump(std::cout);
        }
    }

It throws exception, dumping the following message:

Quote:
Is Factory Null? => 0
Exception:
ErrorData =
ErrorCode = 26 (XMS_E_CONNECT_FAILED)
JMS Type = 1 (XMS_X_GENERAL_EXCEPTION)
Linked Exception:
ErrorData = libmqic_r.so
ErrorCode = 0 (XMS_E_NONE)
JMS Type = 1 (XMS_X_GENERAL_EXCEPTION)



Any idea what is wrong with the code?

Note that `devpmmq` is just an alias to the actual IP address (host). If I put *any* random/nonsense value for it, I get the same error, which is bad because the API should have given a better error message such as *"host not found"* or something alone that line. Is there any way to enable *more* verbose diagnostics?


Last edited by snawaz on Tue May 27, 2014 3:28 am; edited 1 time in total
Back to top
View user's profile Send private message
exerk
PostPosted: Tue May 27, 2014 2:51 am    Post subject: Reply with quote

Jedi Council

Joined: 02 Nov 2006
Posts: 6339

Moved from Links...

...snawaz, next time, please take more care as to which forum you post in, thank you.
_________________
It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys.
Back to top
View user's profile Send private message
MQsysprog
PostPosted: Tue May 27, 2014 3:13 am    Post subject: Reply with quote

Centurion

Joined: 24 Feb 2014
Posts: 116

May i ask if you are trying the connection from a unix 64 bit operating system ?
In this case probably you don't have the correct libraries with the 64 bit
support on your mq installation ,so xms throw the exception ...
Back to top
View user's profile Send private message
RogerLacroix
PostPosted: Tue May 27, 2014 8:27 am    Post subject: Re: Unable to connect to Websphere MQ Manager using XMS Reply with quote

Jedi Knight

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

snawaz wrote:
Quote:
ErrorData = libmqic_r.so

Did you install the MQ client libraries on that server?

snawaz wrote:
Code:
            factory.setStringProperty(XMSC_WMQ_QUEUE_MANAGER, "devpmmq.queue.manager");
            factory.setStringProperty(XMSC_WMQ_HOST_NAME,     "devpmmq");
            factory.setStringProperty(XMSC_WMQ_CHANNEL,       "SYSTEM.DEF.SVRCONN");

3 comments:
- Do not hard-code connection information in your application
- IBM's MQ Best Practices is to use uppercase for MQ object names (queue manager, queues, channels, etc.)
- Do NOT use SYSTEM objects like SYSTEM.DEF.SVRCONN channel.

Regards,
Roger Lacroix
Capitalware Inc.
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General Discussion » Unable to connect to Websphere MQ Manager using XMS
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.