ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » javax.jms.JMSException: MQJMS2007

Post new topic  Reply to topic
 javax.jms.JMSException: MQJMS2007 « View previous topic :: View next topic » 
Author Message
npm2001
PostPosted: Mon Jan 22, 2007 2:55 pm    Post subject: javax.jms.JMSException: MQJMS2007 Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Mon Jan 22, 2007 2:57 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
npm2001
PostPosted: Mon Jan 22, 2007 3:03 pm    Post subject: Reply with quote

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
View user's profile Send private message
npm2001
PostPosted: Mon Jan 22, 2007 3:10 pm    Post subject: Reply with quote

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
View user's profile Send private message
npm2001
PostPosted: Mon Jan 22, 2007 4:44 pm    Post subject: Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Mon Jan 22, 2007 11:58 pm    Post subject: Reply with quote

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
View user's profile Send private message
npm2001
PostPosted: Mon Feb 05, 2007 2:07 pm    Post subject: Reply with quote

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
View user's profile Send private message
sean2007
PostPosted: Mon Feb 26, 2007 10:34 pm    Post subject: The same questions i met Reply with quote

Novice

Joined: 01 Feb 2007
Posts: 14

I'll upgrade my environment to try...
thanks for your information...
Back to top
View user's profile Send private message
sean2007
PostPosted: Wed Feb 28, 2007 2:03 am    Post subject: Message has been sent!!! Thanks. Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Wed Feb 28, 2007 3:13 am    Post subject: Re: Message has been sent!!! Thanks. Reply with quote

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
View user's profile Send private message
RogerLacroix
PostPosted: Wed Feb 28, 2007 9:32 am    Post subject: Re: Message has been sent!!! Thanks. Reply with quote

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
View user's profile Send private message Visit poster's website
Vitor
PostPosted: Thu Mar 01, 2007 12:00 am    Post subject: Re: Message has been sent!!! Thanks. Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » javax.jms.JMSException: MQJMS2007
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.