I got MQJMS2005 error - Websphere

This is a discussion on I got MQJMS2005 error - Websphere ; Hi there, Anybody knows about this error? We have a java program which is supposedly to connect MQ to get message from MQ. We can send messages out to the MQ server fine( it uses the same property file, but ...

+ Reply to Thread
Results 1 to 10 of 10

Thread: I got MQJMS2005 error

  1. I got MQJMS2005 error

    Hi there,

    Anybody knows about this error? We have a java program which is supposedly
    to connect MQ to get message from MQ. We can send messages out to the MQ
    server fine( it uses the same property file, but queue name is different of
    course), but when we run this program to get the message, we got:

    FATAL|Cannot connect to Broker - : - MQJMS2005: failed to create
    MQQueueManager for 'localhost:'

    I read from IBM site that they recommend to explicitly set the values for
    server, port or queuemanager.


    So I explicitly set the values in our property files for the following:

    SAP.mqServer=abc ( I made up the name here)
    SAP.mqPort=1415 ( correct port)

    and It returned the same error, this time with errors: FATAL|Cannot connect
    to Broker - abc:1415 - MQJMS2005: failed to create MQQueueManager for abc

    In Java code initialiation part:


    public static final String QMGR = ""; (This paratmer was not used in
    program according to the programmer)
    public static final String REPLY_QUEUE_TAG = "BILLING.replyQueue";
    public static final String HOST_TAG = "SAP.mqServer";
    public static final String HOST_TAG = "SAP.mqPort";
    public static final String USER_TAG = "SAP.mqUser";
    public static final String PWD_TAG = "SAP.mqPassword";

    the connection class:

    try
    {
    com.ibm.mq.jms.MQQueueConnectionFactory factory;
    factory = (new
    com.ibm.mq.jms.MQQueueConnectionFactory());
    factory.setTransportType(com.ibm.mq.jms.JMSC.MQJMS _TP_CLIENT_MQ_TCPIP);
    if(host !=null && host.length()>0)
    factory.setHostName(host);
    if(port != null && port.length()>0)
    factory.setPort(Integer.parseInt(port));

    connect = factory.createQueueConnection (user, pwd);
    session =
    connect.createQueueSession(false,javax.jms.Session .AUTO_ACKNOWLEDGE);

    }
    catch
    ( javax.jms.JMSException e )
    {
    errMsg = "Cannot connect to Broker - " + host +":"+ port + " - " +
    e.getMessage();
    }
    catch ( Exception e )
    {
    errMsg=e.toString();
    }
    finally
    {
    if ( errMsg !=null )
    {
    logWriter.log(method, logger.FATAL, errMsg);
    logger.log(method, logger.FATAL, errMsg);
    System.exit(1);
    }
    }


    I am not a programmer and I also don't know much about MQ. Is there anybody
    who can help?

    Thanks

    Brian




  2. Re: I got MQJMS2005 error

    Brian,

    First thing is that you will need to print out linked exceptions. Sun?s JMS spec provides a multi-level data structure for exceptions. The top level is a generic JMS message in one of a few broad categories defined by Sun. Below that is a linked exception where the implementation vendor places the really interesting bits. For example, "MQJMS2008: failed to open MQ Queue" is not a particularly revealing error message. But the linked exception prints out the actual WMQ reason code which might be any one of MQRC_OPTION_NOT_VALID_FOR_TYPE, MQRC_UNKNOWN_REMOTE_Q_MGR, MQRC_UNKNOWN_OBJECT_NAME or a number of other possible errors.

    As you can see, the linked exception helps to pinpoint problems in the transport layer and could save hours of debugging time. Printing linked JMS exceptions is a Best Practice. If it is not already a standard in your shop, consider making it one.

    } catch( JMSException je ) {
    System.out.println("caught JMSException: " + je);
    // Add something like this to your code...
    Exception le = je.getLinkedException();
    if (le != null) System.out.println("linked exception: "+le);

    Once you've done this, you will have a much more meaningful error message which you can repost and maybe we can give you a better answer.

    Second thing - if you are local to the QMgr, why use client bindings? If you use server bindings, you do not need the hostname, port or channel. But if you *do* use the client you need all three of these things and it looks like you do not specify the channel.

    -- T.Rob

  3. Re: I got MQJMS2005 error

    Rob,

    Thank you very much for your help. As I said I don't know java and I don't
    know too much about MQ either. We are thrown into this MQ support without
    any training. All we know is start or stop mq pretty much. I will discuss
    with our developer to see if they can make that change in their code. I will
    get back to you guys later on.
    Best Regards

    wrote in message
    news:1960624603.1152894164638.JavaMail.wassrvr@lts gwas010.sby.ibm.com...
    > Brian,
    >
    > First thing is that you will need to print out linked exceptions. Sun?s
    > JMS spec provides a multi-level data structure for exceptions. The top
    > level is a generic JMS message in one of a few broad categories defined by
    > Sun. Below that is a linked exception where the implementation vendor
    > places the really interesting bits. For example, "MQJMS2008: failed to
    > open MQ Queue" is not a particularly revealing error message. But the
    > linked exception prints out the actual WMQ reason code which might be any
    > one of MQRC_OPTION_NOT_VALID_FOR_TYPE, MQRC_UNKNOWN_REMOTE_Q_MGR,
    > MQRC_UNKNOWN_OBJECT_NAME or a number of other possible errors.
    >
    > As you can see, the linked exception helps to pinpoint problems in the
    > transport layer and could save hours of debugging time. Printing linked
    > JMS exceptions is a Best Practice. If it is not already a standard in
    > your shop, consider making it one.
    >
    > } catch( JMSException je ) {
    > System.out.println("caught JMSException: " + je);
    > // Add something like this to your code...
    > Exception le = je.getLinkedException();
    > if (le != null) System.out.println("linked exception: "+le);
    >
    > Once you've done this, you will have a much more meaningful error message
    > which you can repost and maybe we can give you a better answer.
    >
    > Second thing - if you are local to the QMgr, why use client bindings? If
    > you use server bindings, you do not need the hostname, port or channel.
    > But if you *do* use the client you need all three of these things and it
    > looks like you do not specify the channel.
    >
    > -- T.Rob




  4. Re: I got MQJMS2005 error

    Rob,

    Here is the more specific error after they put the linkedexcept:

    2006/07/14
    13:28:42|dtxapp03||weblogic|MemoStatusProcessor|Me moStatusProcessor::start|FATAL|Cannot
    connect to Broker - : - MQJMS2005: failed to create MQQueueManager for
    'localhost:'
    Linked Error :com.ibm.mq.MQException: MQJE001: An MQException occurred:
    Completion Code 2, Reason 2059
    MQJE011: Socket connection attempt refused

    This program is in test server. we have exact same copy of everything in
    production which is working. Everything including property files is the same
    except those queue manager name or different directories. The mq is working
    fine on the server, we can send out messages, but have this problem when
    trying to get the message.

    Regards



    wrote in message
    news:1960624603.1152894164638.JavaMail.wassrvr@lts gwas010.sby.ibm.com...
    > Brian,
    >
    > First thing is that you will need to print out linked exceptions. Sun?s
    > JMS spec provides a multi-level data structure for exceptions. The top
    > level is a generic JMS message in one of a few broad categories defined by
    > Sun. Below that is a linked exception where the implementation vendor
    > places the really interesting bits. For example, "MQJMS2008: failed to
    > open MQ Queue" is not a particularly revealing error message. But the
    > linked exception prints out the actual WMQ reason code which might be any
    > one of MQRC_OPTION_NOT_VALID_FOR_TYPE, MQRC_UNKNOWN_REMOTE_Q_MGR,
    > MQRC_UNKNOWN_OBJECT_NAME or a number of other possible errors.
    >
    > As you can see, the linked exception helps to pinpoint problems in the
    > transport layer and could save hours of debugging time. Printing linked
    > JMS exceptions is a Best Practice. If it is not already a standard in
    > your shop, consider making it one.
    >
    > } catch( JMSException je ) {
    > System.out.println("caught JMSException: " + je);
    > // Add something like this to your code...
    > Exception le = je.getLinkedException();
    > if (le != null) System.out.println("linked exception: "+le);
    >
    > Once you've done this, you will have a much more meaningful error message
    > which you can repost and maybe we can give you a better answer.
    >
    > Second thing - if you are local to the QMgr, why use client bindings? If
    > you use server bindings, you do not need the hostname, port or channel.
    > But if you *do* use the client you need all three of these things and it
    > looks like you do not specify the channel.
    >
    > -- T.Rob




  5. Re: I got MQJMS2005 error

    Brian,

    This is MUCH more helpful. There are a few reasons you would see this:

    1) The QMgr name as specified in the program is wrong.
    2) The connection parameters in the program are wrong.
    3) The channel you are attempting to connect over is stopped or configured to be unusual.
    4) The listener is not running.

    For program samples, look in /opt/mqm/samp/java (Unix) or %MQ_JAVA_CAP_PATH%\Tools\Java (Windows). I really would recommend making sure that you as an administrator can run the Initial Verification Test programs. Then you know the configuration is correct for the programmer.

    For administrative help, have you found the manual set online?
    http://www-306.ibm.com/software/inte...n/wmq/library/

    Click the tab for WMQ 6.0 or 5.3, depending on your version. It will take a while to learn but everything you need is there. Make SURE that your developer knows about the WMQ Using Java manual!! It has everything from setup to programming advice.

    I empathize with you about getting tossed into the WMQ support role without training. Hang in there, it gets better and the WMQ community is always ready to help. If you haven't found it yet, look at http://mqseries.net as another place to post questions. Some people are only on the DW forum, others only on MQSeries.net.

    -- T.Rob

  6. Re: I got MQJMS2005 error

    Hi Guys,

    I also encounter the same error with different reason code

    MQJMS2005: failed to create MQQueueManager for 'ils1app1-dev:ils.queue.manager'
    linked exception: com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2009

    I dont know why it seems all my QCF setting is correct as below
    javaClassName: com.ibm.mq.jms.MQQueueConnectionFactory
    javaFactory: com.ibm.mq.jms.MQQueueConnectionFactoryFactory
    objectClass: javaContainer
    objectClass: javaObject
    objectClass: javaNamingReference
    objectClass: top
    cn: ilsprodQCF
    javaReferenceAddress: #0#VER#1
    javaReferenceAddress: #1#TRAN#1
    javaReferenceAddress: #2#QMGR#ils.queue.manager
    javaReferenceAddress: #3#HOST#ils1app1-dev
    javaReferenceAddress: #4#PORT#1414
    javaReferenceAddress: #5#CHAN#SYSTEM.DEF.SVRCONN
    javaReferenceAddress: #6#CCS#819
    javaReferenceAddress: #7#TM#SYSTEM.DEFAULT.MODEL.QUEUE



    my entry for /etc/hosts as below
    192.168.0.129 ils1app1-dev loghost
    127.0.0.1 localhost


    and my process running in backgroun for mq as below
    mqm 11334 11330 0 Jun 29 ? 0:41 /opt/mqm/bin/amqrrmfa -t2332800 -s2592000 -p2592000 -g5184000 -c3600 -m ils.que
    mqm 11336 11330 0 Jun 29 ? 0:40 /opt/mqm/bin/runmqchi -m ils.queue.manager
    mqm 11335 11330 0 Jun 29 ? 0:36 /opt/mqm/bin/amqzdmaa -m ils.queue.manager
    mqm 9136 1 0 Jun 28 ? 0:00 runmqsc
    mqm 11338 1 0 Jun 29 ? 0:00 runmqlsr -t tcp -m ils.queue.manager -p 1414
    mqm 11332 11330 0 Jun 29 ? 0:05 amqhasmx ils!queue!manager /var/mqm
    mqm 11331 11330 0 Jun 29 ? 0:36 /opt/mqm/bin/amqzfuma -m ils.queue.manager
    root 4900 4892 0 08:39:37 pts/4 0:00 grep mqm
    mqm 11330 1 0 Jun 29 ? 1:34 amqzxma0 -m ils.queue.manager
    mqm 11333 11330 0 Jun 29 ? 0:00 amqzllp0 -mils.queue.manager ?
    mqm 11337 11330 0 Jun 29 ? 1:45 amqzlaa0 -mils.queue.manager -fip0
    mqm 3234 1 0 16:58:12 ? 0:00 amqrmppa -m ils.queue.manager


    Seems listerner is running and so on??


    Any idea?

    Thanks in Advance..

  7. Re: I got MQJMS2005 error

    just_a_kid83@hotmail.com wrote:
    > MQJMS2005: failed to create MQQueueManager for 'ils1app1-dev:ils.queue.manager'
    > linked exception: com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2009


    Reason code 2009 is MQRC_CONNECTION_BROKEN. If you have MQ installed,
    the command mqrc will tell you what a given reason code number
    is as a symbolic constant. You will then find it simpler to search the
    infocenter or the web for more information.

    > Any idea?


    Do you have a firewall which is blocking connections? Was there a
    transient network outage?

    Regards,

    Phil Willoughby
    --
    Software Engineer (Development)
    IBM Message Service Clients for C/C++

  8. Re: I got MQJMS2005 error

    Hi

    Thanks man for the idea.

    But how do i check i am behind firewall or not in UNIX??
    I really new to these kind of UNIX environment..
    By the way i m using IBM MQ 5.3 in Solaris.


    Thanks.

  9. Re: I got MQJMS2005 error

    Hi ,

    I found a new thing after i do netstat -an|grep 1414

    i found all entry is
    127.0.0.1.1414 127.0.0.1.55866 49152 0 49152 0 CLOSE_WAIT
    192.168.0.129.1414 192.168.0.129.58021 49152 0 49152 0 CLOSE_WAIT



    In which scenario and what causes this ? and how do i solve this?
    Thanks.

  10. Re: I got MQJMS2005 error

    Hi Rob,

    Thanks for all the help. Actually on the very same day you replied, I fixed
    the problem. Basically my idea on the original question to actually specify
    the server, port and queuemanager was correct, but the information I entered
    was not correct. After I tried several times, it worked.
    Thank you.
    Brian

    wrote in message
    news:1717600558.1152905550592.JavaMail.wassrvr@lts gwas010.sby.ibm.com...
    > Brian,
    >
    > This is MUCH more helpful. There are a few reasons you would see this:
    >
    > 1) The QMgr name as specified in the program is wrong.
    > 2) The connection parameters in the program are wrong.
    > 3) The channel you are attempting to connect over is stopped or configured
    > to be unusual.
    > 4) The listener is not running.
    >
    > For program samples, look in /opt/mqm/samp/java (Unix) or
    > %MQ_JAVA_CAP_PATH%\Tools\Java (Windows). I really would recommend making
    > sure that you as an administrator can run the Initial Verification Test
    > programs. Then you know the configuration is correct for the programmer.
    >
    > For administrative help, have you found the manual set online?
    > http://www-306.ibm.com/software/inte...n/wmq/library/
    >
    > Click the tab for WMQ 6.0 or 5.3, depending on your version. It will take
    > a while to learn but everything you need is there. Make SURE that your
    > developer knows about the WMQ Using Java manual!! It has everything from
    > setup to programming advice.
    >
    > I empathize with you about getting tossed into the WMQ support role
    > without training. Hang in there, it gets better and the WMQ community is
    > always ready to help. If you haven't found it yet, look at
    > http://mqseries.net as another place to post questions. Some people are
    > only on the DW forum, others only on MQSeries.net.
    >
    > -- T.Rob




+ Reply to Thread