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 » Getting 2009 in multi-threaded app

Post new topic  Reply to topic
 Getting 2009 in multi-threaded app « View previous topic :: View next topic » 
Author Message
sboying
PostPosted: Thu Sep 07, 2006 1:20 pm    Post subject: Getting 2009 in multi-threaded app Reply with quote

Novice

Joined: 07 Sep 2006
Posts: 11

Hello all,

I have an app that basically starts 10 threads every second. Each thread retrieves a preconfigured/started QueueConnection, creates a session from the connection, sender and receiver from the session. Consistently upon the third cycle of sending/receving msgs, it fails on the receive, 31st attempt. Here is the exception:

caught JMSException: javax.jms.JMSException: MQJMS2005: failed to create MQQueueManager for 'ctssnc04.sabre.com:CCTS04'
2006-09-07 15:41:29,772 INFO [STDOUT] linked exception: com.ibm.mq.MQException: MQJE001: An MQException occurred: Completion Code 2, Reason 2009
MQJE016: MQ queue manager closed channel immediately during connect
Closure reason = 2009
2006-09-07 15:41:29,772 ERROR [STDERR] javax.jms.JMSException: MQJMS2005: failed to create MQQueueManager for 'ctssnc04.sabre.com:CCTS04'
2006-09-07 15:41:29,775 ERROR [STDERR] at com.ibm.mq.jms.services.ConfigEnvironment.newException(ConfigEnvironment.java:586)
2006-09-07 15:41:29,775 ERROR [STDERR] at com.ibm.mq.jms.MQConnection.createQM(MQConnection.java:2082)
2006-09-07 15:41:29,775 ERROR [STDERR] at com.ibm.mq.jms.MQConnection.createQMNonXA(MQConnection.java:1496)
2006-09-07 15:41:29,776 ERROR [STDERR] at com.ibm.mq.jms.MQQueueConnection.createQueueSession(MQQueueConnection.java:396)
2006-09-07 15:41:29,776 ERROR [STDERR] at com.ibm.mq.jms.MQQueueConnection.createQueueSession(MQQueueConnection.java:234)


Evironment:

Solaris 5.8
Running out of JBoss 4.0.4GA
MQ ver 6.0

At the end of each thread run(), it closes down what I believe to be necessary resources:

public void closeSession()
{
try
{
if ( queueSender != null )
{
queueSender.close();
queueSender = null;
}

if ( queueReceiver != null )
{
queueReceiver.close();
queueReceiver = null;
}

if ( session != null )
{
session.close();
session = null;
}

}
catch ( JMSException je )
{
je.printStackTrace();
}
}

Thank you,

Shawn
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Sep 07, 2006 2:18 pm    Post subject: Reply with quote

Grand High Poobah

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

Anyway the resource cleanup is NOT clean.
object = null would need to happen in a finally as you could have a JMSException on the close method...

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
sboying
PostPosted: Thu Sep 07, 2006 5:47 pm    Post subject: Reply with quote

Novice

Joined: 07 Sep 2006
Posts: 11

Good point, I'll fix that. Don't believe that is the cause of the MQMgr closing the channel though...
Back to top
View user's profile Send private message
sboying
PostPosted: Fri Sep 08, 2006 8:01 am    Post subject: Reply with quote

Novice

Joined: 07 Sep 2006
Posts: 11

It looks like I'm exahusting the channels, being new to this I'm not sure how to resolve. Does a session.close() not free the channel up? I am using a model of one connection and opening several sessions per connection, what is a feasible # of sessions per connection?

09/07/06 15:30:33 - Process(13249.3107) User(mqm) Program(amqrmppa)
AMQ9513: Maximum number of channels reached.

EXPLANATION:
The maximum number of channels that can be in use simultaneously has been
reached. The number of permitted channels is a configurable parameter in the
queue manager configuration file.
ACTION:
Wait for some of the operating channels to close. Retry the operation when some
channels are available.
----- amqrcsia.c : 1069 -------------------------------------------------------
09/07/06 15:30:33 - Process(13249.3107) User(mqm) Program(amqrmppa)
AMQ9999: Channel program ended abnormally.

EXPLANATION:
Channel program 'SYSTEM.DEF.SVRCONN' ended abnormally.
ACTION:
Look at previous error messages for channel program 'SYSTEM.DEF.SVRCONN' in the
error files to determine the cause of the failure.
----- amqrmrsa.c : 468 --------------------------------------------------------
09/07/06 15:30:33 - Process(13249.3108) User(mqm) Program(amqrmppa)
AMQ9513: Maximum number of channels reached.

EXPLANATION:
The maximum number of channels that can be in use simultaneously has been
reached. The number of permitted channels is a configurable parameter in the
queue manager configuration file.
ACTION:
Wait for some of the operating channels to close. Retry the operation when some
channels are available.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Fri Sep 08, 2006 9:01 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You probably want to apply the latest FP of MQ v6 to your client installation.

You may also want to confirm that JBoss has implemented a proper connection pool, and that you are using it.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
sboying
PostPosted: Fri Sep 08, 2006 10:17 am    Post subject: Reply with quote

Novice

Joined: 07 Sep 2006
Posts: 11

Running with latest Fix pack 6.0.0.1. I don't use MDB's, simply java classes that send and receive msgs, not sure how JBoss connection pools come into play here?
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Fri Sep 08, 2006 10:23 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

I guess I meant 6.0.1.1, not 6.0.0.1.

And you are using JMS. Either you are building your QCFs manually, or you are looking them up in JNDI. In either case, JBoss should be "involved", at least at the point of hosting the JMS provider and giving services TO the JMS provider, like connection pools.

Otherwise, why bother using JMS in an J2EE container, if the container isn't going to provide you any services?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
sboying
PostPosted: Fri Sep 08, 2006 10:49 am    Post subject: Reply with quote

Novice

Joined: 07 Sep 2006
Posts: 11

Thats what I meant, 6.0.1.1. My basic architecture:

Process1/Process2/Process3
|
|
MQ Queues
|
|
EJB~~~~~ManagedBean~~~~~~~MySQLDB

1-MB calls EJB with timed request(every second)
2-EJB retrieves Connection(previously established during JBoss startup, manual -no JNDI lookup), creates the session, sender/receiver.
3-EJB creates/starts multiple threads to each distributed Unix process, which send the request, receive the reply.
3-MB receives the result and inserts into DB.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Fri Sep 08, 2006 12:04 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

sboying wrote:
T2-EJB retrieves Connection(previously established during JBoss startup, manual -no JNDI lookup)


That's a connection pool, then, yes?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
sboying
PostPosted: Mon Sep 11, 2006 11:33 am    Post subject: Reply with quote

Novice

Joined: 07 Sep 2006
Posts: 11

found the problem, the threads were exiting before actually doing a close on the session(client-channel). Thanks.
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 » IBM MQ Java / JMS » Getting 2009 in multi-threaded app
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.