|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
[Solved]Completion code 2 Reason code 2035 |
« View previous topic :: View next topic » |
Author |
Message
|
kevin_22 |
Posted: Wed Aug 02, 2006 3:06 am Post subject: [Solved]Completion code 2 Reason code 2035 |
|
|
 Centurion
Joined: 08 Mar 2005 Posts: 100
|
Hi,
I am trying to establish a remote connection to the QManager existed on other system thru a java program existed on my local system. I created a user "user1" on the other system and added to the 'mqm' group. everything is working fine up to here ie, i could able to Connect to QManager and issuing MQPut . The problem is when i deleted the user "user1" from 'mqm' group, and issing the command setmqaut -m QM1 -n 'in' -t queue -p user1 +all at the other system and running the same java program at my local system it is giving me the error Completion code 2 Reason code 2035'
To my understanding this is a security problem which is not expected as i had given it authorization to connect*.
1)MQEnvironment.userid allows to connect to the Queue Manager.
2)setmqaut allows to the user to restrict or grant access to the QM objects.
which applied true to my java program.
I even tried using refresh security
So, why i am getting this error?
Please help me to resolve this issue.
Windows 2003
MQ 6.0
Thanks,
Kevin 
Last edited by kevin_22 on Thu Aug 03, 2006 3:29 am; edited 1 time in total |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Aug 02, 2006 4:28 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
you probably need to +connect +inq on the qmgr. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
kevin_22 |
Posted: Thu Aug 03, 2006 3:02 am Post subject: |
|
|
 Centurion
Joined: 08 Mar 2005 Posts: 100
|
hi jefflowrey,
It seems that setmqaut commnad is for applying authority for MQ Objects. It got nothing to do with the QM. Onece 'Connect' is made to the QManager we can restrict or apply auth. to the QManager Objects.
I find that the constructor of MQQuemanger is
public MQQueueManager(String queueManagerName, ConnectionManager connectionManager) throws MQException;
where ConnectionManager is from 'package javax.resource.spi'.
Is this got any thing to connect.
Please find the jave code which i am using:
Quote: |
System.out.println("\nStarting...........");
MQEnvironment.hostname = "192.168.200.61";
MQEnvironment.channel = "SrvConn";
MQEnvironment.port = 1414;
MQEnvironment.userID = "user1";
MQEnvironment.properties.put( MQC.TRANSPORT_PROPERTY ,MQC.TRANSPORT_MQSERIES);
int openOptions = MQC.MQOO_INPUT_SHARED|
MQC.MQOO_OUTPUT|MQC.MQOO_INQUIRE|MQC.MQOO_PASS_ALL_CONTEXT;
System.out.println("\nBefore QM connection");
MQQueueManager queueManager = new MQQueueManager("QM1");
System.out.println("\nAfter QM connection");
System.out.println("\nBefore access queue");
MQQueue queue = queueManager.accessQueue("in",openOptions);
System.out.println("\nAfter access queue");
MQMessage message = new MQMessage();
message.writeUTF("user message");
MQPutMessageOptions pmo = new MQPutMessageOptions();
queue.put(message,pmo);
System.out.println("\n\nMQPut done and queue depth :"+queue.getCurrentDepth());
queue.close();
}
catch(IOException e){
System.out.print(e.fillInStackTrace());
}
catch (MQException ex) {
// TODO: handle exception
System.out.println("A WebSphere MQ error occurred : Completion code " +
ex.completionCode + " Reason code " + ex.reasonCode);
}
}
}
|
My doubt is 'in java how i connect to QManager?' It seems that MQQueueManager queueManager = new MQQueueManager("QM1") alone is not sufficient.
Thanks,
Kevin |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Aug 03, 2006 3:05 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
|
Back to top |
|
 |
kevin_22 |
Posted: Thu Aug 03, 2006 3:29 am Post subject: |
|
|
 Centurion
Joined: 08 Mar 2005 Posts: 100
|
Ooops!!!!
I dont know how i over looked this. Its working.
i issued setmqaut -m QM1 -t qmgr +setall
Now it is able to connect .
Great Thanks to jefflowrey.
Thanks,
Kevin |
|
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
|
|
|
|