Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error show in tomcat logs #85

Closed
viswamkalva opened this issue Jul 9, 2017 · 2 comments
Closed

Error show in tomcat logs #85

viswamkalva opened this issue Jul 9, 2017 · 2 comments

Comments

@viswamkalva
Copy link

I see the following error suddenly from today in my tomcat logs and no messages are read from queue in my application, could anyone help me on this:
component.jms.DefaultJmsMessageListenerContainer Could not refresh JMS Connection for destination 'EmployeeQueue' - retrying using FixedBackOff{interval=5000, currentAttempts=1, maxAttempts=unlimited}. Cause: unable to get a connection from pool of a PoolingConnectionFactory with an XAPool of resource jms/ConnectionFactory with 10 connection(s) (0 still available)

@lorban
Copy link
Contributor

lorban commented Jul 10, 2017

The problem seems to be caused by a depleted JMS connection pool:

unable to get a connection from pool of a PoolingConnectionFactory with an XAPool of resource jms/ConnectionFactory with 10 connection(s) (0 still available)

So you've configured a jms/ConnectionFactory pool with a max size of 10 and all 10 connections are used up. This can mean two things:

  1. Your pool is too small for the load you have, and some threads will timeout trying to get a connection from the pool. If your pool eventually recovers (you can monitor how many connections are available by calling PoolingConnectionFactory.getInPoolSize(), or by accessing the JMX MBean) this probably means this is the case.

  2. Connections are being leaked, one way or another. The most probable case is that your code forgets to call close() on the Connection object returned by PoolingConnectionFactory.createConnection(). The JMX MBeans should list all connections and each one has a transactionGtridsCurrentlyHoldingThis property that should help you figure out what transaction is still holding a particular connection. That info, coupled with the list of in-flight transactions identified by their GTRID allows your to find the name of the thread that holds the transaction. This isn't the complete path to the code that leaked the connection, but it should help you narrow down the code that's responsible for that leak.

@viswamkalva
Copy link
Author

Thanks. My issue was falling under 1st point you mentioned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants