|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Cannot connect QM in Client mode using a channel |
« View previous topic :: View next topic » |
Author |
Message
|
pal |
Posted: Mon Sep 16, 2002 12:10 pm Post subject: Cannot connect QM in Client mode using a channel |
|
|
Apprentice
Joined: 14 Aug 2001 Posts: 35
|
These are the steps I followed on HP-UX 11.11 and MQ 5.2
1. crtmqm testqm
2. strmqm testqm
3. define channel (mychannel) chltype(svrconn) mcauser(userid)
4. runmqlsr -t tcp -p 1414 -m testqm
5. started my client program below
MQEnvironment.properties.put(MQC.HOST_NAME_PROPERTY, "localhost");
MQEnvironment.properties.put(MQC.CHANNEL_PROPERTY, "mychannel");
MQEnvironment.properties.put(MQC.PORT_PROPERTY, new Integer(1414));
MQEnvironment.properties.put( MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_CLIENT );
MQQueueManager tempQm = new MQQueueManager( qmName );
This fails with the following exception
com.ibm.mq.MQException: Completion Code 2, Reason 2009
at com.ibm.mq.MQManagedConnectionJ11.<init>(MQManagedConnectionJ11.java:166)
at com.ibm.mq.MQClientManagedConnectionFactoryJ11._createManagedConnection(MQClientManagedConnectionFactoryJ11.java:196)
at com.ibm.mq.MQClientManagedConnectionFactoryJ11.createManagedConnection(MQClientManagedConnectionFactoryJ11.java:213)
at com.ibm.mq.StoredManagedConnection.<init>(StoredManagedConnection.java:80)
at com.ibm.mq.MQSimpleConnectionManager.allocateConnection(MQSimpleConnectionManager.java:150)
at com.ibm.mq.MQQueueManager.obtainBaseMQQueueManager(MQQueueManager.java:560)
at com.ibm.mq.MQQueueManager.construct(MQQueueManager.java:509)
at com.ibm.mq.MQQueueManager.<init>(MQQueueManager.java:286)
at mq_connector.main(mq_connector.java:26)
and the runmqlsr window shows the following messages
09/16/02 16:39:09 AMQ9519: Channel 'mychannel' not found.
09/16/02 16:39:09 AMQ9999: Channel program ended abnormally.
Any ideas? |
|
Back to top |
|
 |
RogerLacroix |
Posted: Mon Sep 16, 2002 9:05 pm Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
MQ is case-sensitive. Therefore "mychannel" does NOT equal "MyChannel".
Did you use runmqsc to define the channel? If so, when you did the command:
Quote: |
define channel (mychannel) chltype(svrconn) mcauser(userid) |
the channel name got convert to upper-case.
Because you did NOT use quotes (') in the channel name, runmqsc upper-cased the name. Your channel name is now "MYCHANNEL".
If you want to use lower case (I suggest that you do not) then you need to do your defines as follows:
Quote: |
define channel ('mychannel') chltype(svrconn) mcauser(userid) |
later
Roger... _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
pal |
Posted: Wed Sep 18, 2002 1:25 pm Post subject: |
|
|
Apprentice
Joined: 14 Aug 2001 Posts: 35
|
Fixed the case, but now I am getting a not authorized to perform action exception, even though the used id is part of the mqm group
com.ibm.mq.MQException: Completion Code 2, Reason 2035
at com.ibm.mq.MQManagedConnectionJ11.<init>(MQManagedConnectionJ11.java:166)
at com.ibm.mq.MQClientManagedConnectionFactoryJ11._createManagedConnection(MQClientManagedConnectionFactoryJ11.java:196)
at com.ibm.mq.MQClientManagedConnectionFactoryJ11.createManagedConnection(MQClientManagedConnectionFactoryJ11.java:213)
at com.ibm.mq.StoredManagedConnection.<init>(StoredManagedConnection.java:80)
at com.ibm.mq.MQSimpleConnectionManager.allocateConnection(MQSimpleConnectionManager.java:150)
at com.ibm.mq.MQQueueManager.obtainBaseMQQueueManager(MQQueueManager.java:560)
at com.ibm.mq.MQQueueManager.construct(MQQueueManager.java:509)
at com.ibm.mq.MQQueueManager.<init>(MQQueueManager.java:286)
at mq_connector.main(mq_connector.java:26) |
|
Back to top |
|
 |
RogerLacroix |
Posted: Wed Sep 18, 2002 8:31 pm Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
What value did you set for:
Code: |
MQEnvironment.userID = "???"; |
Has this UserId been given access to the queue manager?
later
Roger... _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
pal |
Posted: Thu Sep 19, 2002 5:10 am Post subject: |
|
|
Apprentice
Joined: 14 Aug 2001 Posts: 35
|
I use the properties method to populate the MQEnvironment and below are the values:
Code: |
MQEnvironment.properties.put( MQC.HOST_NAME_PROPERTY, "machine name" );
MQEnvironment.properties.put( MQC.CHANNEL_PROPERTY, "MYCHANNEL" );
MQEnvironment.properties.put( MQC.PORT_PROPERTY, new Integer( 1416 ) );
MQEnvironment.properties.put( MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_CLIENT );
MQEnvironment.properties.put( MQC.USER_ID_PROPERTY, "user id in the mqm group" ); |
If I use the following channel name then the example seems to work:
Code: |
MQEnvironment.properties.put( MQC.CHANNEL_PROPERTY, "SYSTEM.DEF.SVRCONN" ); |
|
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|