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 » MQJE001: An MQException occurred: Completion Code 2, Reason

Post new topic  Reply to topic
 MQJE001: An MQException occurred: Completion Code 2, Reason « View previous topic :: View next topic » 
Author Message
Gopalakrishna N
PostPosted: Wed Mar 15, 2006 3:56 pm    Post subject: MQJE001: An MQException occurred: Completion Code 2, Reason Reply with quote

Newbie

Joined: 14 Mar 2006
Posts: 6
Location: Texas

Hi all

I am trying to run a Java class which will do nothing other than put a message into the MQ queue. I also have another java application which would read the same message..

While trying to run the java class, its giving me the below error:
MQJE001: An MQException occurred: Completion Code 2, Reason 2059
MQJE011: Socket connection attempt refused
MQJE001: An MQException occurred: Completion Code 2, Reason 2059
MQJE011: Socket connection attempt refused
com.ibm.mq.MQException: MQJE001: An MQException occurred: Completion Code 2, Rea
son 2059
MQJE011: Socket connection attempt refused

From another post here, I found that reason could be with SSL setting, I tried setting the same explicitly. Still no success.

All masters, kindly help me resolve this issue pls..

Thanks and Regards,
Gopalakrishna N
Back to top
View user's profile Send private message Yahoo Messenger
vennela
PostPosted: Wed Mar 15, 2006 5:05 pm    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

Is your app running in client mode or bindings mode?
Are you using SSL at all?
Is the listener running if you are using client mode?
Tell us a little more
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Gopalakrishna N
PostPosted: Wed Mar 15, 2006 5:31 pm    Post subject: Reply with quote

Newbie

Joined: 14 Mar 2006
Posts: 6
Location: Texas

I am a newbie to MQ. So kindly pardon if I miss any details.

I am not using any SSL and Am connecting as a client. Have MQ server set up in my machine, configured the QMGR/Remote Queue/Sender Channel and everything. Yes the listener is running in client mode. Please do help me out.

Thanks and Regards,
Gopalakrishna N
Back to top
View user's profile Send private message Yahoo Messenger
mvic
PostPosted: Wed Mar 15, 2006 5:41 pm    Post subject: Re: MQJE001: An MQException occurred: Completion Code 2, Rea Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

Gopalakrishna N wrote:
MQJE011: Socket connection attempt refused

Perhaps the app is being blocked by a firewall rule, either on client, or server, or in the network in between. Or perhaps the listener is not running on the right port?

Do you have any messages in the qmgr error log on the server side, corresponding to the app failures? If indeed a firewall is preventing the connection attempt, you will find nothing related at all in the qmgr error logs.

Also, did you check out previous experiences of this at http://www.google.co.uk/search?q=MQJE011
Back to top
View user's profile Send private message
wschutz
PostPosted: Wed Mar 15, 2006 5:59 pm    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

I use telnet to see if it's possible to reach a listener
(assuming in this case you think the listener should be listenining on port 1111 on "localhost"):
Quote:

C:\mqm\Qmgrs\CEP_QM\errors>telnet localhost 1111
Connecting To localhost...Could not open a connection to host on port 1111 : Connect failed

means that you can't reach the listener or a firewall is blocking it (in this case on port 1111).
If the screen clears and telnet just hangs, then you can connect to the listener and should see sometinhg like this in the error log on the server (because MQ doesn't understand the "telnet" protocol):
Quote:
----- amqrccca.c : 777 --------------------------------------------------------
3/15/2006 20:51:34 - Process(2032.16) User(wschutz) Program(amqrmppa.exe)
AMQ9209: Connection to host 't41p (127.0.0.1)' closed.

EXPLANATION:
An error occurred receiving data from 't41p (127.0.0.1)' over TCP/IP. The
connection to the remote host has unexpectedly terminated.
ACTION:
Tell the systems administrator.
----- amqccita.c : 3263 -------------------------------------------------------
3/15/2006 20:51:34 - Process(2032.16) User(wschutz) Program(amqrmppa.exe)
AMQ9492: The TCP/IP responder program encountered an error.

EXPLANATION:
The responder program was started but detected an error.
ACTION:
Look at previous error messages in the error files to determine the error
encountered by the responder program.
----- amqrmrsa.c : 459 ----------------------------------------------------

_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
vennela
PostPosted: Wed Mar 15, 2006 6:53 pm    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

Posting your code might help too
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Gopalakrishna N
PostPosted: Wed Mar 15, 2006 7:08 pm    Post subject: Reply with quote

Newbie

Joined: 14 Mar 2006
Posts: 6
Location: Texas

Hi

This is the code I used, which is downloaded from the net. I just added an option to set the Posted Message format to EBCDIC using the option mentioned below. (though even after commenting my code changes, the code doesnt work).

Thanks a lot all for the inputs so far. Tried everything and confirmed with the admin too that there are no firewalls running, was able to telnet too.

Thanks a ton again.

Thanks and Regards,
Gopalakrishna N



===============================================
import com.ibm.mq.*;
import java.io.IOException;
import java.util.Hashtable;
import java.io.*;

public class MQWrite {
private MQQueueManager _queueManager = null;
private Hashtable params = null;
public int port = 1415;
public String hostname = <ipaddress>;
public String channel = "TEST.VER.CH";
public String qManager = "GMONI001";
public String outputQName = "TEST.VER.RQ";


public MQWrite()
{
super();
}

private void init() throws IllegalArgumentException
{

// Set up MQ environment
MQEnvironment.hostname = hostname;
MQEnvironment.channel = channel;
MQEnvironment.port = port;

}
public static void main(String[] args)
{

MQWrite write = new MQWrite();

try
{
write.init();
write.selectQMgr();
write.write();
}
catch (IllegalArgumentException e)
{
System.out.println("Usage: java MQWrite <-h host> <-p port> <-c channel> <-m QueueManagerName> <-q QueueName>");
System.exit(1);
}
catch (MQException e)
{
System.out.println(e);
System.exit(1);
}
}
private void selectQMgr() throws MQException
{
_queueManager = new MQQueueManager(qManager);
}
private void write() throws MQException
{
String line = "Hi Swaroop, H u doin";
int lineNum=0;
int openOptions = MQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCING;
try
{
MQQueue queue = _queueManager.accessQueue( outputQName,
openOptions,
null, // default q manager
null, // no dynamic q name
null ); // no alternate user id

DataInputStream input = new DataInputStream(System.in);

System.out.println("MQWrite v1.0 connected");
System.out.println("and ready for input, terminate with ^Z\n\n");

// Define a simple MQ message, and write some text in UTF format..
MQMessage sendmsg = new MQMessage();
sendmsg.format = MQC.MQFMT_STRING;
sendmsg.feedback = MQC.MQFB_NONE;
sendmsg.messageType = MQC.MQMT_DATAGRAM;
sendmsg.replyToQueueName = "ROGER.QUEUE";
sendmsg.replyToQueueManagerName = qManager;

MQPutMessageOptions pmo = new MQPutMessageOptions(); // accept the defaults, same
// as MQPMO_DEFAULT constant

sendmsg.clearMessage();
sendmsg.messageId = MQC.MQMI_NONE;
sendmsg.correlationId = MQC.MQCI_NONE;
sendmsg.characterSet = 37; //Setting to AMERICAN EBCDIC format
sendmsg.writeString(line);

// put the message on the queue

queue.put(sendmsg, pmo);


queue.close();
_queueManager.disconnect();

}
catch (com.ibm.mq.MQException mqex)
{
System.out.println(mqex);
}
catch (java.io.IOException ioex)
{
System.out.println("An MQ IO error occurred : " + ioex);
}

}
}
Back to top
View user's profile Send private message Yahoo Messenger
RogerLacroix
PostPosted: Wed Mar 15, 2006 10:41 pm    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3264
Location: London, ON Canada

Hi,

To connect to a mainframe queue manager, you need to have the CAF (Client Attachment Feature) installed. On the mainframe, go to SDSF and look in the xxxxCHIN (where xxxx is the queue manager name) output for a message:
Code:
CSQX099I - xxxx CSQXGIP Client attachment feature available

If this message doesn't show up, then you don't have the feature installed. The CAF is a required for any client program to connect directly to a mainframe queue manager.

Also, this code is a bad, very bad idea.
Quote:
sendmsg.characterSet = 37; //Setting to AMERICAN EBCDIC format


Finally, I wonder where you downloaded the code from?
Quote:
sendmsg.replyToQueueName = "ROGER.QUEUE";


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
wschutz
PostPosted: Thu Mar 16, 2006 2:44 am    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

Are you connecting to an MVS (zOS) qmgr? If so, this can't be correct:
Quote:
public String qManager = "GMONI001";
as MVS qmgr names can't be > 4 chars....
_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » MQJE001: An MQException occurred: Completion Code 2, Reason
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.