Search code examples
javaibm-mq

MQJE001: Completion Code '2', Reason '2538'


public class PtpReceiver {

public static void main(String[] args) {
    // TODO Auto-generated method stub
    try {
        MQEnvironment.hostname = "192.168.120.28:1415";
        MQEnvironment.channel = "SFMS.TO.CBS";
        MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY,
                MQC.TRANSPORT_MQSERIES);
        System.out.println("Q manager");
        MQQueueManager qMgr = new MQQueueManager("GSCBBRQM");
        System.out.println("Q manager11");

    }

    catch (MQException ex) {
        System.out.println(ex.completionCode+ ex.reasonCode);
        }
}

}

I got the error following:

MQJE001: Completion Code '2', Reason '2538'.

Can any one help me for solve this error


Solution

  • That is JMS code for doing a connection via for WMQ for JMS. Bhaumik is using WMQ for Java (non JMS).

    Bhaumik, you do not specify the port number in the hostname but rather as follows:

    public static void main(String[] args) {
        try {
            MQEnvironment.hostname = "192.168.120.28";
            MQEnvironment.port     = 1415;
            MQEnvironment.channel  = "SFMS.TO.CBS";
            MQQueueManager qMgr = new MQQueueManager("GSCBBRQM");
        }
    
        catch (MQException ex) {
            System.out.println("CC="+ex.completionCode + " : RC="+ ex.reasonCode);
            }
    }