|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
MQ Exception |
« View previous topic :: View next topic » |
Author |
Message
|
satya2005 |
Posted: Sun Dec 25, 2005 10:07 pm Post subject: MQ Exception |
|
|
Novice
Joined: 25 Dec 2005 Posts: 11
|
Hi,
Greetings!,
I am able to read the queue messages which are in Default queue manager(created while installing MQ series.)
i created one more queue manager with name "Test" port number 1420, created one queue "testqueue" , and Server Connection Channel "CHANNEL1". i put some message in that queue thru MQ Explorer, PutMessage option. i am able to see the message.
when i am trying to read the message thru my java program it is giving the following error. but the same code is working for the default queue manager queues.
MYCODE:
-----------
import com.ibm.mq.* ;
public class MessReceiverTest {
public static void main(String args[]) {
try
{
String hostName = "localhost" ;
String channel = "CHANNEL1" ;
String qManager="Test";
String qName = "testqueue" ;
//Set up the MQEnvironment properties for Client Connections
MQEnvironment.hostname = hostName ;
MQEnvironment.port = 1420;
MQEnvironment.channel = channel ;
MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY,MQC.TRANSPORT_MQSERIES);
MQQueueManager qMgr = new MQQueueManager(qManager) ;
int openOptions = MQC.MQOO_INPUT_SHARED | MQC.MQOO_FAIL_IF_QUIESCING ;
MQQueue queue = qMgr.accessQueue(qName,openOptions,null,null,null);
MQGetMessageOptions gmo = new MQGetMessageOptions();
gmo.options = gmo.options + MQC.MQGMO_SYNCPOINT ;
gmo.options = gmo.options + MQC.MQGMO_WAIT ;
gmo.options = gmo.options + MQC.MQGMO_FAIL_IF_QUIESCING ;
gmo.waitInterval = 3000 ;
MQMessage inMsg = new MQMessage();
queue.get(inMsg, gmo) ;
String msgString = inMsg.readString(inMsg.getMessageLength());
System.out.println(" The Message from the Queue is : " + msgString);
qMgr.commit();
queue.close();
qMgr.disconnect();
}
catch (MQException ex)
{
System.out.println("An MQ Error Occurred: Completion Code is :\t" +
ex.completionCode + "\n\n The Reason Code is :\t" + ex.reasonCode );
ex.printStackTrace();
}
catch(Exception e) {
e.printStackTrace();
}
}
}
Exception:
-----------
MQJE001: An MQException occurred: Completion Code 2, Reason 2035
MQJE036: Queue manager rejected connection attempt
MQJE001: An MQException occurred: Completion Code 2, Reason 2035
MQJE036: Queue manager rejected connection attempt
An MQ Error Occurred: Completion Code is : 2
The Reason Code is : 2035
com.ibm.mq.MQException: MQJE001: An MQException occurred: Completion Code 2, Rea
son 2035
MQJE036: Queue manager rejected connection attempt
at com.ibm.mq.MQManagedConnectionJ11.<init>(MQManagedConnectionJ11.java:
242)
at com.ibm.mq.MQClientManagedConnectionFactoryJ11._createManagedConnecti
on(MQClientManagedConnectionFactoryJ11.java:276)
at com.ibm.mq.MQClientManagedConnectionFactoryJ11.createManagedConnectio
n(MQClientManagedConnectionFactoryJ11.java:296)
at com.ibm.mq.StoredManagedConnection.<init>(StoredManagedConnection.jav
a:80)
at com.ibm.mq.MQSimpleConnectionManager.allocateConnection(MQSimpleConne
ctionManager.java:171)
at com.ibm.mq.MQQueueManager.obtainBaseMQQueueManager(MQQueueManager.jav
a:754)
at com.ibm.mq.MQQueueManager.construct(MQQueueManager.java:688)
at com.ibm.mq.MQQueueManager.<init>(MQQueueManager.java:417)
at MessReceiverTest.main(MessReceiverTest.java:27)
Caused by: com.ibm.mqservices.MQInternalException: MQJE001: An MQException occur
red: Completion Code 2, Reason 2035
MQJE036: Queue manager rejected connection attempt
at com.ibm.mq.MQInternalCommunications.connectToQueueManager(MQInternalC
ommunications.java:2613)
at com.ibm.mq.MQInternalCommunications.<init>(MQInternalCommunications.j
ava:569)
at com.ibm.mq.MQSESSIONClient.MQCONN(MQSESSIONClient.java:1316)
at com.ibm.mq.MQManagedConnectionJ11.<init>(MQManagedConnectionJ11.java:
218)
... 8 more
Kindly provide the solution.
warm regards,
Satya |
|
Back to top |
|
 |
satya2005 |
Posted: Sun Dec 25, 2005 11:15 pm Post subject: solved the problem by passing userid,pwd , if u |
|
|
Novice
Joined: 25 Dec 2005 Posts: 11
|
i got the solution by passing these parameters.
MQEnvironment.userID="satya"; //nt userid withadministrator permissions
MQEnvironment.password="pwd";//nt password
right now i am not in domain.
if i am in some domain will this program work , what is this mqm group.
can any one throw light. where to set the following parameters
if you set PUTAUT(DEF), any channel connecting to this RCVR will get MCA authorizations and no other thence; if you set PUTAUT(CTX) then a userid and authorizations will be assigned per message according to MQMD.UserId; I cannot tell which you use, since possibly you put the msg under user "abc", thus the err msg you got doesn't necessarily imply DEF.
Kindly explain me above thing.
regards,
satya |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Dec 26, 2005 10:18 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
if my memory serves me well 2035 is NOT_AUTHORISED....
Please read up in the admin manual and specifically about command setmqaut...
Check out as well the new mqrc commands from 6.0 as I believe you can now set authorization there.
Do not forget to run the refresh security command (mqrc)...
Enjoy  |
|
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
|
|
|
|