File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JBoss/WildFly and the fly likes JBoss Jms connectionpool problem? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "JBoss Jms connectionpool problem?" Watch "JBoss Jms connectionpool problem?" New topic

JBoss Jms connectionpool problem?

bill lubx

Joined: May 04, 2002
Posts: 26
Hey friends:
I have adapt a sample petstore 1.3.1 runing on the best breed: Jboss and Mysql, at, all the code is in cvs,

the application using a session bean (it should be a stateless) to send the message to a queue, in the home.create() method it create connection factory and queue, in the send method, it create connection, session and sender to send the message, I have closes the session and connection after sending. Since stateless bean is instantiated when server start, which means the connection factory and connection is set up from very beginning. When a call to this bean�s create method, it just grab the connection from stateless bean pool, after sending message to the queue, and close the session and connection, it should handled by the container to return the connection to the pool. But client side (action class OrderEJBAction in petstore1.3.x) throw an illegal state exception that try to return an unknown connection to Jboss connection pool , later on, Jboss keeping warn me for un closed jms connections from jms connection pool,
where is the problem?


Honk if you hate bumper stickers that say "Honk if ..."
bill lubx

Joined: May 04, 2002
Posts: 26
I figured out the reason and fixed

Jo Joe

Joined: Oct 21, 2003
Posts: 1
i also have problems with stateless session beans and JMS. The session bean
is triggered by a message driven bean. It add some additional informationen to the message and sends the message to another queue. This works fine for the first message - but after this, i get the following exception:
[TxConnectionManager$TxConnectionEventListener] throwable from unregister connection
java.lang.IllegalStateException: Trying to return an unknown connection1! org.jboss.resource.adapter.jms.JmsSession@7f1228
The session bean is still triggered by the messag driven bean, but the method is not able to send another message to the out-queue.
After the first exception i also get the following information:
CachedConnectionManager] Successfully closed a connection for you. Please close them yourself: org.jboss.resource.adapter.jms.JmsSession@7f1228
Can somebody help me?
Thank you,
bill lubx

Joined: May 04, 2002
Posts: 26
these are my fixes,
In AsyncSenderEJB, do:
1.moving QueueConnection to class level sendAMessage method, change the session to AUTO_ACKNOWLEDGE,
session = qConnect.createQueueSession(true,Session.AUTO_ACKNOWLEDGE); final block, close session
finally {
try {
// Matrix Change close session for JBOss 3.2.1 session unclosed Exception
if( session != null ) {
} catch(Exception e) {}
} ejbRemove () set queue connection and queue factory to null.
public void ejbRemove() {

qConnect = null;
qFactory = null;

These should help you to properly close the queue session.
[ February 15, 2004: Message edited by: bill lubx ]
I agree. Here's the link:
subject: JBoss Jms connectionpool problem?
It's not a secret anymore!