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 » Unable to connect to QM using .net core xms client 9.1.4

Post new topic  Reply to topic
 Unable to connect to QM using .net core xms client 9.1.4 « View previous topic :: View next topic » 
Author Message
bway
PostPosted: Wed Feb 19, 2020 9:39 am    Post subject: Unable to connect to QM using .net core xms client 9.1.4 Reply with quote

Newbie

Joined: 19 Feb 2020
Posts: 6

I am using the samples provided with the 9.1.4 client. I am trying to access a QM running 9.1.2. At the point that the factory attempts to create the connection I am getting the following error that I have no idea what to do with. I can't find any documentation or references to the "destinationArrary" parameter. Can anyone lend any insight?

Quote:

"CWSMQ0006E: An exception was received during the call to the method ConnectionFactory.CreateConnection: System.ArgumentNullException: Value cannot be null. (Parameter 'destinationArray')
at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable)
at IBM.WMQ.MQFAP.NmqiConnect(String name, NmqiConnectOptions pNmqiConnectOpts, MQConnectOptions cno, Hconn remoteParentHconn, Phconn pHconn, Int32& compCode, Int32& reason, ManagedHconn rcnHconn)
at IBM.WMQ.MQFAP.NmqiConnect(String pQMgrName, NmqiConnectOptions pNmqiConnectOpts, MQConnectOptions pConnectOpts, Hconn parentHconn, Phconn pHconn, Int32& pCompCode, Int32& pReason)
at IBM.XMS.Client.WMQ.WmqConnection..ctor(NmqiEnvironment nmqiEnv, NmqiMQ nmqiMQ, XmsPropertyContext connectProps)
at IBM.XMS.Client.WMQ.Factories.WmqConnectionFactory.CreateV7ProviderConnection(XmsPropertyContext connectionProps).
During execution of the specified method an exception was thrown by another component.
See the linked exception for more information."


As I said, I am running the sample application, here is the code that is running:
Code:

            XMSFactoryFactory factoryFactory;
            IConnectionFactory cf;
            IConnection connectionWMQ;
            ISession sessionWMQ;
            IDestination destination;
            IMessageConsumer consumer;
            ITextMessage textMessage;

            // Get an instance of factory.
            factoryFactory = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);

            // Create WMQ Connection Factory.
            cf = factoryFactory.CreateConnectionFactory();
           
            Console.WriteLine("Connection Factory created.");

            // Set the properties
            cf.SetStringProperty(XMSC.WMQ_HOST_NAME, "localhost");
            cf.SetIntProperty(XMSC.WMQ_PORT, 1414);
            cf.SetStringProperty(XMSC.WMQ_CHANNEL, "DEV.APP.SVRCONN");
            cf.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT);
            cf.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, "QM1");

            // Create connection.
            connectionWMQ = cf.CreateConnection();
            Console.WriteLine("Connection created.");
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Feb 19, 2020 9:44 am    Post subject: Re: Unable to connect to QM using .net core xms client 9.1.4 Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

bway wrote:
Can anyone lend any insight?

Quote:

"CWSMQ0006E: An exception was received during the call to the method ConnectionFactory.CreateConnection: System.ArgumentNullException: Value cannot be null. (Parameter 'destinationArray')

.....

See the linked exception for more information."


So what does the linked exception say?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
bway
PostPosted: Wed Feb 19, 2020 10:01 am    Post subject: Reply with quote

Newbie

Joined: 19 Feb 2020
Posts: 6

"Value cannot be null...." is the Linked Exception.

Quote:

LinkedException {"Value cannot be null. (Parameter 'destinationArray')"} System.Exception {System.ArgumentNullException}
[/quote]
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Feb 19, 2020 11:51 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

bway wrote:
"Value cannot be null...." is the Linked Exception.

Quote:

LinkedException {"Value cannot be null. (Parameter 'destinationArray')"} System.Exception {System.ArgumentNullException}


It should say a lot more than that. The linked exception (or in the event of a chained exception, the lowest one) will contain the IBM reason code from the underlying library (or assembly, I speak .NET with an accent).

Given that you're running the provided sample and on the face of it there's nothing wrong with your code I suspect the problem is environmental; that this "value cannot be null" is the .NET equivalent (and as much use as) the Java Null Pointer Exception. In both cases the fact that you've ended up with a null is the symptom not the cause of your problems.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Wed Feb 19, 2020 12:07 pm    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9394
Location: US: west coast, almost. Otherwise, enroute.

Please post the entire conversation with no omissions.
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
bway
PostPosted: Wed Feb 19, 2020 1:44 pm    Post subject: Reply with quote

Newbie

Joined: 19 Feb 2020
Posts: 6

You seem to be right about it being an environmental issue. When using .net core the sight of the error is in System.Private.CoreLib and when targeting .net framework it's in mscorlib. Both are .net libraries. Unfortunately I am no closer to solving the problem. Not even really sure where to start.
Back to top
View user's profile Send private message
RogerLacroix
PostPosted: Wed Feb 19, 2020 2:34 pm    Post subject: Re: Unable to connect to QM using .net core xms client 9.1.4 Reply with quote

Jedi Knight

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

bway wrote:
Code:
connectionWMQ = cf.CreateConnection();

Humm, is it complaining that you did not set a UserId and Password? Try setting it.
Code:
connectionWMQ = cf.CreateConnection(myUser, myPwd);


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
fjb_saper
PostPosted: Thu Feb 20, 2020 5:34 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

Well a few things.

Looking at the connection, I believe the Client connection will require the full MQ C client. See if you can change that to a MANAGED connection.

As for the User Name and Password, don't forget to add, to the connection factory, the boolean property about using the MQCSP set up, and set it to true.

Hope this helps
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Vitor
PostPosted: Thu Feb 20, 2020 6:13 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

bway wrote:
Not even really sure where to start.


You need to find the linked exception with the actual, IBM supplied error in it.

While I agree with my worthy associates about the most likely cause (a security issue), it's not optimal to fix a problem without understanding why the fix works. Also you don't want to have to come back here for more guesses the next time this blows up on you (I'm assuming that getting the sample application to work is not the pinnacle of your ambitions with MQ).
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
bway
PostPosted: Thu Feb 20, 2020 6:39 am    Post subject: Reply with quote

Newbie

Joined: 19 Feb 2020
Posts: 6

Thank you all for your time and suggestions.

I have come to the conclusion that it is a problem with the 9.1.4 version of the client. If I use the EXACT SAME code and reference the 9.1.3 version of the client dlls everything works perfectly.

Also, I did notice that the last long term support release version of the client is 9.1.0.4. The 9.1.3 and 9.1.4 versions are Continuous Delivery Releases. I guess that's what I get for not paying attention and living on the bleeding edge.
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Feb 20, 2020 6:58 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

bway wrote:
I have come to the conclusion that it is a problem with the 9.1.4 version of the client. If I use the EXACT SAME code and reference the 9.1.3 version of the client dlls everything works perfectly.


Raise a PMR; gain comfort that you've helped some other poor soul.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
bway
PostPosted: Thu Feb 20, 2020 7:00 am    Post subject: Reply with quote

Newbie

Joined: 19 Feb 2020
Posts: 6

That's a good idea, how would I do that? I speak IBM with an accent
Back to top
View user's profile Send private message
bway
PostPosted: Thu Feb 20, 2020 7:06 am    Post subject: Reply with quote

Newbie

Joined: 19 Feb 2020
Posts: 6

Figure it out, thanks!
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Feb 20, 2020 7:55 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

bway wrote:
I speak IBM with an accent


Falch ichi ei weithio allan!
_________________
Honesty is the best policy.
Insanity is the best defence.
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 » Unable to connect to QM using .net core xms client 9.1.4
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.