Author |
Message
|
shubhu_s |
Posted: Wed Dec 20, 2006 12:22 pm Post subject: MQJMS2007: MQJE001: Completion Code 2, Reason 2009 |
|
|
Newbie
Joined: 19 Dec 2006 Posts: 2
|
Hi,
My JMS client is on Wondows 2003 Server and Websphere App Server and Websphere MQ are intalled on an AIX box.
As per our system requirement, we have to have a communication between the two.
I'm able to obtain app server initial context, queue connection factory for MQ Queue Manager and also able to receive messages from inbound queue using JMS APIs. As soon as my client invokes sender.send(msg), MQ throws an error
JMS exception: [Ljava.lang.StackTraceElement;@5b4ef564 MQJMS2007: failed to send message to MQ queue
Linked exception: com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2009
and client loses the connection to app server.
I have searched through the net, but could not find a concrete solution to the problem and tried number of ways to resolve it.
I think its a problem with MQ then the configuration, because when I can read the message successfully, why should not it allow me to write.
Please help.
Thanks'
Shubhendu Shrivastava |
|
Back to top |
|
 |
killer |
Posted: Wed Dec 20, 2006 1:21 pm Post subject: |
|
|
 Apprentice
Joined: 06 Jul 2006 Posts: 35
|
Hi,
Check the channel are running fine or not.
And check ,the status of channel after ur client want to send the message.
Reason code 2009,indicates there is connection issue,so make sure communication link is fine and check the channel attributes.
 |
|
Back to top |
|
 |
shubhu_s |
Posted: Wed Dec 20, 2006 1:38 pm Post subject: |
|
|
Newbie
Joined: 19 Dec 2006 Posts: 2
|
I've verified channel, there is absolutely no problem with it. in fact my program is smart enough to re-obtain the connection as soon as it looses it..
Are there any security attibutes at Websphere or MQ level, which do not allow me to write to the quque and disconnect the client as soon as it tries that? |
|
Back to top |
|
 |
killer |
Posted: Wed Dec 20, 2006 3:22 pm Post subject: |
|
|
 Apprentice
Joined: 06 Jul 2006 Posts: 35
|
I don't think there,is any security issue as you only mentioed that u are getting 2009 reason code,which is MQRC_CONNECTION_BROKEN.
This indicates connection with the Qmgr is lost.
Had there been any security issue ,u would have got 2035 error.Isn't it?
 |
|
Back to top |
|
 |
wschutz |
Posted: Wed Dec 20, 2006 3:29 pm Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
Common problem... search here for 2009 and JMS
Is there a firewall? _________________ -wayne |
|
Back to top |
|
 |
java_ppl |
Posted: Thu Dec 21, 2006 9:48 am Post subject: |
|
|
Novice
Joined: 22 Sep 2006 Posts: 13
|
|
Back to top |
|
 |
JosephGramig |
Posted: Thu Dec 21, 2006 10:28 am Post subject: |
|
|
 Grand Master
Joined: 09 Feb 2006 Posts: 1244 Location: Gold Coast of Florida, USA
|
With the Search link at the top of the page.  _________________ Joseph
Administrator - IBM WebSphere MQ (WMQ) V6.0, IBM WebSphere Message Broker (WMB) V6.1 & V6.0
Solution Designer - WMQ V6.0
Solution Developer - WMB V6.1 & V6.0, WMQ V5.3 |
|
Back to top |
|
 |
java_ppl |
Posted: Fri Jan 05, 2007 3:47 am Post subject: |
|
|
Novice
Joined: 22 Sep 2006 Posts: 13
|
Hi shubhu_s,
Quote: |
my program is smart enough to re-obtain the connection as soon as it looses it.. |
Please could you post this piece of code ? My application is trying to do the same , but keeps throwing the 2009 Connection broken exception .
Thanks. |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Jan 05, 2007 4:10 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I'm sure shubbhu_s doesn't do anything more complicated than repeat the same code.
If you are unable to achieve a connection when you retry it after it fails - then either you are not properly repeating all of the necessary code to create a good connection. OR there is something sufficiently wrong with the QUEUE MANAGER or the NETWORK that your program won't be able to reconnect without manual intervention.
You need to write code to cover both those cases. This is not hard, if you think about it. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
java_ppl |
Posted: Mon Feb 12, 2007 5:57 am Post subject: |
|
|
Novice
Joined: 22 Sep 2006 Posts: 13
|
Hi Ive tried the following:
boolean flag=true
while(flag)
{
If queue Manager connected
then Print : QManager Connected
If queue connected
then Print : Q Connected
try{
queue.get(message, gmo);
flag=false;
}
catch(Exception e1)
{
queue.disconnect();
queueManager.disconnect();
//Establish a new connection using a function
createWMQObjects(Config.getQueueManagerName(),
,Config.getQueueName());
}
}
The function createWMQObjects definition looks like this:
public static void createWMQObjects(String queueManagerName, String appQueueName) {
createQueueManager(queueManagerName);
createAppQueue(appQueueName,
MQC.MQOO_OUTPUT );
createStatusQueue(appQueueName +
Config.getStatusQueueSuffix(),
MQC.MQOO_INPUT_EXCLUSIVE
| MQC.MQOO_OUTPUT
| MQC.MQOO_BROWSE);
}
createQueueManager Definition:
queueManager = new MQQueueManager(queueManagerName);
createAppQueue Defintion :
appQueue = accessQueue(queueName, openOptions);
createStatusQueue Definition:
statusQueue = accessQueue(queueName, openOptions);
----------------------------------------------------------------------------
After runnning the code;the output loooks like this:
Inside getMessage() Function...
***QManager Connected***
***Queue Connected***
Exception occurred 1!!
com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2009
Exception occurred 2!!
com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2019
***QManager Disconnected***
***Queue Connected***
Exception occurred 1!!
com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2019
Exception occurred 2!!
com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2019
***QManager Disconnected***
***Queue Connected***
Exception occurred 1!!
com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2019
Exception occurred 2!!
com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2019
***QManager Disconnected***
***Queue Connected***
Exception occurred 1!!
and so on......................
Please could you tell me what the problem could be?
Thanks.
jp |
|
Back to top |
|
 |
java_ppl |
Posted: Mon Feb 12, 2007 6:01 am Post subject: |
|
|
Novice
Joined: 22 Sep 2006 Posts: 13
|
uh .. the code looks more like this..
while(flag)
{
If queue Manager connected
then Print : QManager Connected
If queue connected
then Print : Q Connected
try{
queue.get(message, gmo);
flag=false;
}
catch(Exception e1)
{
Print : Exception 1 occurred
queue.disconnect();
queueManager.disconnect();
//Establish a new connection using a function
try{
createWMQObjects(Config.getQueueManagerName(),
,Config.getQueueName());
}
catch(Exception e2)
{
Print : Exception 2 occurred;
}
}
} |
|
Back to top |
|
 |
|