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 » Clustering » Problem with JMS on Clustered MQ Websphere OS/390

Post new topic  Reply to topic
 Problem with JMS on Clustered MQ Websphere OS/390 « View previous topic :: View next topic » 
Author Message
sriraj
PostPosted: Wed Dec 08, 2004 1:17 am    Post subject: Problem with JMS on Clustered MQ Websphere OS/390 Reply with quote

Newbie

Joined: 08 Dec 2004
Posts: 3

Hello,

We have a problem that begs urgent attention and I would appreciate any help I can receive at this point of time.

A little background; we are testing a point to point service which uses MQ for messaging. We tested the service / MQ using WSAD and everything works fine. We are using pure JMS and not MQ JMS. When we deploy on Websphere and then try communicating to the MQs (which are clustered) we recieve an error: MQJMS 2008 Failed to Open the Queue.

A little more detail, we are listening on one queue and processing the incoming message, after which we are posting to an outgoing queue. We are able to listen to the incoming queue and pickup the message. This incoming message also contains the queue name to which we must post on the outgoing side. When we try to post to this queue, we recieve the above error. I am posting the code snippet also below

Code:

// Create all the JMS objects
      Queue queue = null;
      QueueConnectionFactory queueConnectionFactory = null;
      QueueSession queueSession = null;
      QueueConnection queueConnection = null;
      QueueSender queueSender = null;
      TextMessage message = null;

      try {

// Obtain the queue name from the incoming message and strip out the queue manager. Basically the end result will look like queue:///XXXX.HOME
         queueName = returnMessageQueue.toString();
         queueName = queueName.substring(15,35);

         // get the instance of the ejbFactory class
         ejbFactory = EJBFactory.getInstance();
         
         // look up the queue connection factory
         queueConnectionFactory =
            ejbFactory.lookUpQueueConnectionFactory(
               queueConnectionFactoryJndiName,
               queueConnectionFactoryClassName);
               
         // obtain a queue connection
         queueConnection = queueConnectionFactory.createQueueConnection();
         
         // create a queue session
         queueSession =
            queueConnection.createQueueSession(
               true,
               Session.AUTO_ACKNOWLEDGE);
         
         returnMessageQueue = queueSession.createQueue(queueName);
         
         // create a queueSender which will send the message on the queue
         queueSender = queueSession.createSender(returnMessageQueue);
      
         
         // create an object of type message fronm the string message
         
         message = queueSession.createTextMessage(returnMessage);
         
         queueConnection.start();
         //send the message
         queueSender.send(message);


Please help! I'd really appreciate any help I can get. If you need more info, please post and I'll reply ASAP.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Dec 08, 2004 3:50 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Where do you assign returnMessageQueue?

How do you know that your substring is returning a valid value?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
sriraj
PostPosted: Wed Dec 08, 2004 7:44 am    Post subject: Reply with quote

Newbie

Joined: 08 Dec 2004
Posts: 3

We are printing out the value in the logs and it is a valid queue name. Another symptom that we are having is the messages are getting lost enroute to the outgoing queue without a trace. The message is processed and then the send operation takes place but the message never goes to the outgoing queue. Can someone please help.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Dec 08, 2004 7:55 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

What is the MQException that is attached to the JMS Exception?

"The message never goes to the output queue" usually means "I didn't commit the transaction".
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
bower5932
PostPosted: Wed Dec 08, 2004 7:56 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

Get the linked exception:
Code:

    } catch( JMSException je ) {
       System.out.println("JMS Exception: " + je);
       // check for a linked exception
       Exception le = je.getLinkedException();
       if (le != null) {
          System.out.println("Linked exception: " + le);
       }
   }

This will give you the underlying WMQ error which will point to what is wrong. And if you are getting a 2085, then you actually need to make sure that the underlying WMQ queue for the JNDI q is created.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
fjb_saper
PostPosted: Wed Dec 08, 2004 1:59 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20697
Location: LI,NY

A better way would be to add
Code:
import com.ibm.mq.jms.*;
and then clear the qmgr name:
Code:
(MQQueue(returnMessageQueue)).setQManager("");


This is from memory so forgive me if it is not so precise.
Enjoy
Back to top
View user's profile Send private message Send e-mail
sriraj
PostPosted: Wed Dec 08, 2004 7:31 pm    Post subject: Reply with quote

Newbie

Joined: 08 Dec 2004
Posts: 3

Thank you all for your help. The problem has been resolved. The root cause was that the queue manager was not a part of the cluster, so it did not have the ability to write to messages in the cluster. Thus the messages were getting lost and the error.

Thanks again
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 » Clustering » Problem with JMS on Clustered MQ Websphere OS/390
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.