Topic
  • No replies
PrashantHSawant
PrashantHSawant
1 Post

Pinned topic Failed to initialize XMSFactoryFactory

‏2016-11-21T06:53:10Z | xmsfactoryfactory

I have IBM WebSphere MQ Explorer 7.5.0.1 on my machine.  I try to write sample dot.net application to connect othere MQ server.

Below is code I had try

 

try
            {
                XMSFactoryFactory factoryFactory = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);

                IConnectionFactory connectionFactory = factoryFactory.CreateConnectionFactory();
                //connectionFactory.SetStringProperty(XMSC.WMQ_HOST_NAME, instance.HostName);
                //connectionFactory.SetStringProperty(XMSC.USERID, instance.UserID);
                //connectionFactory.SetIntProperty(XMSC.WMQ_PORT, instance.Port);
                connectionFactory.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT);
                connectionFactory.SetIntProperty(XMSC.WMQ_CLIENT_RECONNECT_TIMEOUT, instance.ReconnectTimeout); // In seconds
                connectionFactory.SetIntProperty(XMSC.WMQ_CLIENT_RECONNECT_OPTIONS, XMSC.WMQ_CLIENT_RECONNECT);
                connectionFactory.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, System.Net.Dns.GetHostName().ToUpper());//System.Net.Dns.GetHostName().ToUpper()
                connectionFactory.SetStringProperty(XMSC.WMQ_CONNECTION_NAME_LIST, instance.HostNameList);
                connectionFactory.SetStringProperty(XMSC.WMQ_CHANNEL, instance.Channel);

                return connectionFactory;
            }

 

-----------------------

In above code for first highlighted code line it gives error

Message - "Fatal error. Failed to initialize XMSFactoryFactory"

StackTrace -    at IBM.XMS.XMSFactoryFactory.GetXmsFactory(Int32 connectionType)
   at IBM.XMS.XMSFactoryFactory.GetInstance(Int32 connectionType)
   at FuturesCacheMQServiceLib.OXAccountMQManager.GetMQConnectionFactory(MQInstance instance)

 

Any one can help to resolve above error

 

Updated on 2016-11-21T06:54:03Z at 2016-11-21T06:54:03Z by PrashantHSawant