Author |
Message
|
npm2001 |
Posted: Mon Jan 22, 2007 2:55 pm Post subject: javax.jms.JMSException: MQJMS2007 |
|
|
Newbie
Joined: 22 Jan 2007 Posts: 5
|
I am trying to send message from websphere 6 to MQ Server installed on remote server within our network.
If I use Websphere MQ Client API, I am able to send message.. extract of sample code for this is :
MQEnvironment.hostname = hostName;
MQEnvironment.channel = channel;
MQEnvironment.port = port;
Websphere MQ is configured on remote server with channel, listner and queue correctly configured.
However, If I use JMS API and QueueConnectionFactory/MQ Destination Queue object configured on Websphere, I am getting following error at the time of sending message:
J2CA0056I: The Connection Manager received a fatal connection error from the Resource Adaptor for resource JMS$GapCf$JMSManagedConnection@1832525414. The exception which was received is javax.jms.JMSException: MQJMS2007: failed to send message to MQ queue
Here is my code:
public String sendMesage(String msgText) {
String jndiCF = "jms/GapQcf";
String jndiDest = "jms/GapContractQ";
String retVal = "";
QueueSession session = null;
QueueConnection conn = null;
QueueSender sender = null;
System.out.println("------------------Here in Send Message");
try {
InitialContext context = new InitialContext();
QueueConnectionFactory qcf = (QueueConnectionFactory) context
.lookup(jndiCF);
conn = qcf.createQueueConnection();
conn.start();
session = conn.createQueueSession(true, Session.AUTO_ACKNOWLEDGE);
final Queue q = (Queue) context.lookup(jndiDest);
sender = session.createSender(q);
TextMessage message = session.createTextMessage(msgText);
sender.send(message);
System.out.println(retVal);
} catch (NamingException ne) {
System.out.println("NamingException Exception " + ne.getMessage());
} catch (JMSException jmse) {
System.out.println("JMSException Exception " + jmse.getMessage());
jmse.printStackTrace();
} catch (Exception e) {
System.out.println("Exception " + e.getMessage());
e.printStackTrace();
} finally {
try {
if (sender != null)
sender.close();
} catch (Exception e) {
}
try {
if (session != null)
session.close();
} catch (Exception e) {
}
try {
if (conn != null)
conn.close();
} catch (Exception e) {
}
}
return retVal;
}
I will greatly appreciate your much needed help..
Thanks,
npm2001 |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Jan 22, 2007 2:57 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
What is the value of the linked exception? _________________ MQ & Broker admin |
|
Back to top |
|
 |
npm2001 |
Posted: Mon Jan 22, 2007 3:03 pm Post subject: |
|
|
Newbie
Joined: 22 Jan 2007 Posts: 5
|
I believe linked exception is MQJMS2007 : failed to send message to MQ queue
Here is the stack trace I get at sender.send(message);
[1/22/07 17:18:08:931 EST] 00000040 SystemOut O JMSException Exception MQJMS2007: failed to send message to MQ queue
[1/22/07 17:18:08:961 EST] 00000040 ConnectionEve A J2CA0056I: The Connection Manager received a fatal connection error from the Resource Adaptor for resource JMS$GapCf$JMSManagedConnection@1832525414. The exception which was received is javax.jms.JMSException: MQJMS2000: failed to close MQ queue
[1/22/07 17:18:08:971 EST] 00000040 ConnectionEve A J2CA0056I: The Connection Manager received a fatal connection error from the Resource Adaptor for resource JMS$GapCf$JMSManagedConnection@1832525414. The exception which was received is javax.jms.JMSException: MQJMS2000: failed to close MQ queue
[1/22/07 17:18:08:981 EST] 00000040 ConnectionEve A J2CA0056I: The Connection Manager received a fatal connection error from the Resource Adaptor for resource JMS$GapCf$JMSManagedConnection@1832525414. The exception which was received is javax.jms.JMSException: MQJMS2000: failed to close MQ queue
[1/22/07 17:18:09:211 EST] 00000040 LocalTranCoor E WLTC0016E: Resource JMS$GapCf$JMSManagedConnection@1832525414 failed to complete. Exception stack trace follows: javax.transaction.xa.XAException |
|
Back to top |
|
 |
npm2001 |
Posted: Mon Jan 22, 2007 3:10 pm Post subject: |
|
|
Newbie
Joined: 22 Jan 2007 Posts: 5
|
Sorry Linked Exception is : com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2009
[1/22/07 18:08:58:416 EST] 00000043 SystemOut O Linked Exception = com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2009 |
|
Back to top |
|
 |
npm2001 |
Posted: Mon Jan 22, 2007 4:44 pm Post subject: |
|
|
Newbie
Joined: 22 Jan 2007 Posts: 5
|
As a simple experiment I deployed same code on our test server and I am able to send messages now to the MQ..
I have to find though what is preventing my local environment (Windows 2000 SP4, RAD 6, Websphere Server 6 ) for the error.. |
|
Back to top |
|
 |
Vitor |
Posted: Mon Jan 22, 2007 11:58 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Search the forum for 2009 - it's one of the more common reason codes and has often been discussed, usually to the sound of teeth grinding or foreheads furrowing. It's a kind of catch-all for "your client connection's gone funny".
You'll find a raft of possible causes.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
npm2001 |
Posted: Mon Feb 05, 2007 2:07 pm Post subject: |
|
|
Newbie
Joined: 22 Jan 2007 Posts: 5
|
I got this resolved now..
I had Websphere 6.0.0 running on my local server which came with Rational Application Developer..
After an upgrade to Rational Application Developer to 6.0.1.1 and Websphere Test environment to 6.0.2.5 I am able to send messages using configured JNDI objects poting to websphere message queue on network..
Important advise though on Rational update was use Rational Product Updater after fresh restart of PC. also make sure RAService.exe (IBM Agent Controller) servic e is not running before you begin this upgrade..
Thanks.. |
|
Back to top |
|
 |
sean2007 |
Posted: Mon Feb 26, 2007 10:34 pm Post subject: The same questions i met |
|
|
Novice
Joined: 01 Feb 2007 Posts: 14
|
I'll upgrade my environment to try...
thanks for your information... |
|
Back to top |
|
 |
sean2007 |
Posted: Wed Feb 28, 2007 2:03 am Post subject: Message has been sent!!! Thanks. |
|
|
Novice
Joined: 01 Feb 2007 Posts: 14
|
Hi, npm2001,
Thanks a lot. Your information is the most important for this problem.
I believe Webshpere & MQ are so bad to use and it is very unstable.
However, Thanks again.
Sean |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Feb 28, 2007 3:13 am Post subject: Re: Message has been sent!!! Thanks. |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
sean2007 wrote: |
I believe Webshpere & MQ are so bad to use and it is very unstable. |
Thousands and thousands of very large companies disagree with you to the extent that they are betting their entire business on these products.
Believe what you like, but don't be surprised to find out you're wrong. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
RogerLacroix |
Posted: Wed Feb 28, 2007 9:32 am Post subject: Re: Message has been sent!!! Thanks. |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
sean2007 wrote: |
Thanks a lot. Your information is the most important for this problem. |
Please don't confuse your problems or limited experience with WebSphere MQ (aka MQSeries) with how the product performs.
In the earlier 90's, IBM build MQ for the financial services market place (banks, insurance, etc..). I was fortunate enough to be working at a bank's middleware team in the 90's when IBM came calling with a beta of MQ for mainframe.
Our team (as did other companies) provided a list of MUST haves for the 'MQ product' and #1 and #2 on that list was reliability and stability.
I have been working with MQ ever since. Some IBM products may not get a gold star but I'm always impressed with MQ.
Regards,
Roger Lacroix
Capitalware Inc, _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
Vitor |
Posted: Thu Mar 01, 2007 12:00 am Post subject: Re: Message has been sent!!! Thanks. |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
sean2007 wrote: |
I believe Webshpere & MQ are so bad to use and it is very unstable.
|
I never cease to be amazed how we all manage with it at all these places that have foolishly installed it...  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|