Author |
Message
|
greg |
Posted: Fri Mar 25, 2005 8:07 am Post subject: MQSeries Client in .NET |
|
|
Novice
Joined: 24 Mar 2005 Posts: 20
|
Hi, I posted similar topic on this forum, but a lot of time I changed my configuration on MQSeries Server site, so a lot of people from this forum reproved my that in this way they can't help me.
So I am starting new topic, and I am not going to change anything on the configuration until somebady give an advice.
I have two machine:
1. On a machine_1 ( "10.0.0.99(1115)" ) I instaled MQSeries Server and Client, and I created:
QueueManagerName = "TVTEST";
QueueName = "QUEUE.TEST" it is local queue
channelName = "SVRCONN.TEST" - it is server connection channel
2. On a machine_2 (10.0.0.66) I instaled MQSeries Client and MQ classes for .NET
I added MQSERVER environment variable on this machine like below:
MQSERVER = SVRCONN.TEST/TCP/10.0.0.99(1115)
and I tried to run sample program which was added to MQ classes for .NET package, but I got an error:
An unhandled exception of type 'System.NullReferenceException' occurred in amqmdnet.dll
Additional information: Object reference not set to an instance of an object.
Both machines runs Windows XP
any advice???? |
|
Back to top |
|
 |
Michael Dag |
Posted: Fri Mar 25, 2005 8:38 am Post subject: |
|
|
 Jedi Knight
Joined: 13 Jun 2002 Posts: 2607 Location: The Netherlands (Amsterdam)
|
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Mar 25, 2005 11:40 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
The MQServer environment variable does not work in .NET like in c
With the client .NET classes the behavior for connection information is much closer to the java environment.
Read up on .NET documentation and set your
MQEnvironment class properties.
Enjoy  |
|
Back to top |
|
 |
greg |
Posted: Fri Mar 25, 2005 1:03 pm Post subject: |
|
|
Novice
Joined: 24 Mar 2005 Posts: 20
|
1. How I can use amqsputc.exe from machine_2 to machine_1???
On machine_2 I have not created any queue.
2. I seted MQEnvironment class but still the same error. |
|
Back to top |
|
 |
Michael Dag |
Posted: Fri Mar 25, 2005 1:08 pm Post subject: |
|
|
 Jedi Knight
Joined: 13 Jun 2002 Posts: 2607 Location: The Netherlands (Amsterdam)
|
amqsputc is using the MQ Client to connect to the QM on machine 1
so when all is well...
amqsputc QUEUE.TEST TVTEST should do the trick ...
if amqsputc fails, you have got something wrong in your configuration as amqsputc is known to work... _________________ Michael
MQSystems Facebook page |
|
Back to top |
|
 |
greg |
Posted: Fri Mar 25, 2005 1:16 pm Post subject: |
|
|
Novice
Joined: 24 Mar 2005 Posts: 20
|
Ok, now I understand your point.
I going to try it when I will go to work.
Thank you. |
|
Back to top |
|
 |
malammik |
Posted: Mon Mar 28, 2005 6:54 am Post subject: |
|
|
 Partisan
Joined: 27 Jan 2005 Posts: 397 Location: Philadelphia, PA
|
|
Back to top |
|
 |
greg |
Posted: Tue Mar 29, 2005 12:39 am Post subject: |
|
|
Novice
Joined: 24 Mar 2005 Posts: 20
|
When I tried run amqsputc QUEUE.TEST TVTEST on the server side I got en error:
MQCONN ended with reason code 2058
When I tried use amqsputc command to MQ manager, and queue which were created default when I instaled MQSeries I got the same error. |
|
Back to top |
|
 |
Michael Dag |
Posted: Tue Mar 29, 2005 12:56 am Post subject: |
|
|
 Jedi Knight
Joined: 13 Jun 2002 Posts: 2607 Location: The Netherlands (Amsterdam)
|
you say serverside so I think you did amqsputc on machine1 ?
on machine1 did you set: SET MQSERVER=SVRCONN.TEST/TCP/10.0.0.99(1115) ? _________________ Michael
MQSystems Facebook page |
|
Back to top |
|
 |
greg |
Posted: Tue Mar 29, 2005 8:16 am Post subject: |
|
|
Novice
Joined: 24 Mar 2005 Posts: 20
|
I heard that for .NET it is not necessary set this environment:
SET MQSERVER=SVRCONN.TEST/TCP/10.0.0.99(1115)
(for C++ is it but now for . NET)
However I changed this fragment of code:
Code: |
queueManager = new MQQueueManager( QueueManagerName, channelName, connectionName ); |
and I added new one:
Code: |
MQEnvironment.hostname = "10.0.0.99";
MQEnvironment.channel = "SVRCONN.TEST";
MQEnvironment.port = 1115; |
and it works for me!!! |
|
Back to top |
|
 |
Michael Dag |
Posted: Tue Mar 29, 2005 9:11 am Post subject: |
|
|
 Jedi Knight
Joined: 13 Jun 2002 Posts: 2607 Location: The Netherlands (Amsterdam)
|
greg wrote: |
I heard that for .NET it is not necessary set this environment:
SET MQSERVER=SVRCONN.TEST/TCP/10.0.0.99(1115)
|
you said you were using amqsputc, that's what I responded to
greg wrote: |
(for C++ is it but now for . NET)
However I changed this fragment of code:
Code: |
queueManager = new MQQueueManager( QueueManagerName, channelName, connectionName ); |
and I added new one:
Code: |
MQEnvironment.hostname = "10.0.0.99";
MQEnvironment.channel = "SVRCONN.TEST";
MQEnvironment.port = 1115; |
and it works for me!!! |
good! happy MQing  _________________ Michael
MQSystems Facebook page |
|
Back to top |
|
 |
greg |
Posted: Wed Mar 30, 2005 7:33 am Post subject: |
|
|
Novice
Joined: 24 Mar 2005 Posts: 20
|
I wrote connsol application in .NET which can connect to MQServer and it works.
But when I created web application using the same way like abowe I got an error:
IBM.WMQ.MQException: MQRC_NOT_AUTHORIZED
I checked my code and it looks ok.
Any idea??? I omited some setting???? |
|
Back to top |
|
 |
Michael Dag |
Posted: Wed Mar 30, 2005 7:42 am Post subject: |
|
|
 Jedi Knight
Joined: 13 Jun 2002 Posts: 2607 Location: The Netherlands (Amsterdam)
|
greg wrote: |
IBM.WMQ.MQException: MQRC_NOT_AUTHORIZED
I checked my code and it looks ok.
Any idea??? I omited some setting???? |
I think the Web App does not run as the same userid as you tested the console application with.
Use the search button above and search for "2035" error, should give you enough hits and hints  _________________ Michael
MQSystems Facebook page |
|
Back to top |
|
 |
greg |
Posted: Thu Mar 31, 2005 1:10 am Post subject: |
|
|
Novice
Joined: 24 Mar 2005 Posts: 20
|
I added new user to mqm grupe (greg\appnet) on the server side.
Should I put this user to the MAC user ID in propreties of channel SVRCONN?
Now I didn't get error 2035 but MQRC_Q_MGR_NOT_AVAILABLE
And now even my consol application don't works...since I added this user |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Mar 31, 2005 5:08 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Did you run (runmqsc) REFRESH SECURITY ?
You need to make sure the qmgr got the changes in security.
 |
|
Back to top |
|
 |
|