Author |
Message
|
mqsi |
Posted: Sat Jul 09, 2005 6:31 am Post subject: JMS Exceptions while connecting the MQServer |
|
|
Apprentice
Joined: 11 Jun 2004 Posts: 33
|
One of our applicatoins is using JMS to connect to MQserver.
We are using Static JMS connection which is initialised in the servlet init() method, (when the appserver instance is started).
We are getting the following errors in our log files and these errors are coming intermittently and MQ is running fine with svrconn channel is fine and running.
We are not sure as to why the JMS exception is occuring intermittently. Whenever the connection is lost to the MQ Server the JMS QCF conn handle becomes invalid and the log files grow rapidly forcing appserver restart.
javax.jms.JMSException: MQJMS2002: failed to get message from MQ queue
com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2019
We are using MQ5.3 and appserver and MQ are running on same Solaris server. |
|
Back to top |
|
 |
csmith28 |
Posted: Sat Jul 09, 2005 7:29 am Post subject: |
|
|
 Grand Master
Joined: 15 Jul 2003 Posts: 1196 Location: Arizona
|
Here's what the WMQ Messages Guid has to say about Reason Code 2019
2019 X’07E3’ MQRC_HOBJ_ERROR
The object handle Hobj is not valid. If the handle is a shareable handle, the handle may have been made invalid by another thread issuing the MQCLOSE call using that handle. If the handle is a nonshareable handle, the call may have been issued by a thread that did not create the handle. This reason also occurs if the parameter pointer is not valid, or (for the MQOPEN call) points to read-only storage. (It is not always possible to detect parameter pointers that are not valid; if not detected, unpredictable results occur.)
Corrective action: Ensure that a successful MQOPEN call is performed for this object, and that an MQCLOSE call has not already been performed for it. For MQGET and MQPUT calls, also ensure that the handle represents a queue object. Ensure that the handle is being used within
its valid scope. _________________ Yes, I am an agent of Satan but my duties are largely ceremonial. |
|
Back to top |
|
 |
mqsi |
Posted: Mon Jul 11, 2005 10:28 pm Post subject: |
|
|
Apprentice
Joined: 11 Jun 2004 Posts: 33
|
I know the resolution given in MQ user guide.
But the problem here is, the connection is lost intermittently and we are getting couple of JMS errors in our log files.
If there are connection issue at MQ front, the JMS conn handle tries to connect MQ and throws recursive errors. The log gets full within no time and brings down the j2ee application on the appserver.
In our case, the MQ is running fine and appserver is running fine but once in a while we receive the below JMS errors. These errors refer to the connectivity failures but we are not sure where the connection failure happening.
Both Appserver and MQserver are running on the same system.
When Appserver and MQ are running fine what are the possibilities that connection fails between JMS server and MQ server.
Errors in the appserver log file
javax.jms.JMSException: MQJMS2002: failed to get message from MQ queue
com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2019
Whenever we get the JMS exceptions MQ error log is updated as below.
MQ Error log
07/11/05 01:32:06 AM
AMQ9209: Connection to host ''hostname (xxxxxxxxxx)' closed.
EXPLANATION:
An error occurred receiving data from 'hostname (xxxxxxxxxx)' over TCP/IP.
The connection to the remote host has unexpectedly terminated.
ACTION:
Tell the systems administrator.
-----------
We are not sure what is causing the connection to fail... Some one please help us in this regard. |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Jul 12, 2005 2:43 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
This looks like a client connection and not server connection.
Are you sure there is no other thread that is issuing a connection.close() ?
Looks to me like it might be a threading problem.
Enjoy  |
|
Back to top |
|
 |
mqsi |
Posted: Tue Jul 12, 2005 3:52 am Post subject: |
|
|
Apprentice
Joined: 11 Jun 2004 Posts: 33
|
Servlet is establising the JMS connection and JMS is binding to MQ in client mode. This is a client connection only.
JMS Connection is static and is established in the servlet init() method. connection will be closed in destroy method only..
We are not closing the connection. Don't know if there are other possibiliites that connection can break intermittently..
Request thread puts the message into JMS queue and invokes the Response thread to listen on the reply queue.
This is the QCF definition in JMS. Any changes need to the attributes.
QCF(test)
FAILIFQUIESCE(YES)
HOSTNAME(xxxxxxxxxx)
PORT(1414)
QMANAGER(test)
USECONNPOOLING(YES)
CCSID(819)
TEMPMODEL(SYSTEM.DEFAULT.MODEL.QUEUE)
MSGBATCHSZ(10)
TRANSPORT(CLIENT)
SYNCPOINTALLGETS(NO)
TEMPQPREFIX()
MSGRETENTION(YES)
RESCANINT(5000)
POLLINGINT(5000)
LOCALADDRESS()
VERSION(2)
CHANNEL(SYSTEM.DEF.SVRCONN) |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Jul 12, 2005 1:08 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Hope this is not production (system.def.svrconn).
Otherwise everything looks fine.
However if the hostname is not the local host you might experience channel hickups in the TCP layer...
Don't know in which case you would need a connection listener. But you may have to code for connection failure and its consequences in the servlet.
Enjoy  |
|
Back to top |
|
 |
mqsi |
Posted: Wed Jul 13, 2005 1:52 am Post subject: |
|
|
Apprentice
Joined: 11 Jun 2004 Posts: 33
|
Its in production..
Do you want to change the channel naming convention..
Since the host is localhost, the communcation failures are ruled out.
We are checking for connection at session level and connection factory level. Not sure how the connection failure is happening...
May be in code level in catch block we have to reestablish the connection..
Not sure how the servlet reacts to the conn restarts which is started in the init() method.. |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Jul 13, 2005 4:16 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
What is your max con handles ?
You should really let the app server pool the connections and open and close the resource when needed.
As you are using the client connection make sure as well that the max channels is high enough.
Reason for not using the SYSTEM.DEF.SVRCONN channel:
a) put mcausr('none') on it. Leaving this value blank allows anybody to connect in Java client mode with the authority of the process running the MQ Listener.....
b) define a different svrconn channel. Set the mcausr and the permissions for the usr to match your needs.
Enjoy  |
|
Back to top |
|
 |
mqsi |
Posted: Thu Jul 14, 2005 4:17 am Post subject: |
|
|
Apprentice
Joined: 11 Jun 2004 Posts: 33
|
During peak load, about 5-6 svrconn chl's are running from application.
The max channels limit in mq configurations (qm.ini) is not set. so it should be 100 default. or is there a way we can set the channels limit at JMS QCF level...
I shall define new svrconn chl and when we assign usr to mcausr shud it be 'appadm' usr since the request is coming from websphere appserver. correct me here..
And what are the permissions one can set for usr. |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Jul 14, 2005 3:44 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Read up on MQ Security in the admin guide. This should explain a lot.
As when you define the number of connections in the pool read up on JMSTopology -- see my previous posts...
And yes you may have to up the limits.
Enjoy  |
|
Back to top |
|
 |
|