aspose file tools*
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
Author

JBoss Jms connectionpool problem?

bill lubx
Greenhorn

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 http://sourceforge.net/projects/matrixpetstore/, 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?

bill


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

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

bill
Jo Joe
Greenhorn

Joined: Oct 21, 2003
Posts: 1
Hello,
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
java.lang.Exception
Can somebody help me?
Thank you,
Joe
bill lubx
Greenhorn

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

qConnect = null;
q=null;
qFactory = null;
}

These should help you to properly close the queue session.
[ February 15, 2004: Message edited by: bill lubx ]
 
jQuery in Action, 2nd edition
 
subject: JBoss Jms connectionpool problem?
 
Similar Threads
jdeveloper look up error for jms
Separating JMS Producer/Consumer on JBoss 4.0.2
MDB listening to external MQ in Glassfish
ejb Stateless SessionBean send JMS msg's
MDB in weblogic problem