You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by Dignesh <dg...@opentext.com> on 2016/09/06 13:34:10 UTC

PoolExhaustedException in logs

Hi,

My application is deployed on TomEE. It works fine for sometime, but after
few hours I see these below exceptions in the log. Is the pool size is
configurable in tomee.xml file.I do see few properties that can be specified
for a resource in documentation, I am not sure which one is applicable for
the below issue?Can some one please help me on this.

Caused by: org.hibernate.exception.GenericJDBCException: could not prepare
statement
	at
org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:54)
	at
org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:124)
	at
org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:193)
	at
org.hibernate.engine.jdbc.internal.StatementPreparerImpl.prepareQueryStatement(StatementPreparerImpl.java:157)
	at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1881)
	at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1858)
	at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1838)
	at org.hibernate.loader.Loader.doQuery(Loader.java:906)
	at
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:348)
	at org.hibernate.loader.Loader.doList(Loader.java:2550)
	at org.hibernate.loader.Loader.doList(Loader.java:2536)
	at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2366)
	at org.hibernate.loader.Loader.list(Loader.java:2361)
	at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:495)
	at
org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:357)
	at
org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:198)
	at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1194)
	at org.hibernate.internal.QueryImpl.list(QueryImpl.java:101)
	at
com.artesia.server.user.entity.UserStorageManager.retrieveTeamsUser(UserStorageManager.java:1700)
	... 33 more
Caused by: org.apache.tomcat.jdbc.pool.PoolExhaustedException: [Default JMS
Resource Adapter-worker- - 68] Timeout: Pool empty. Unable to fetch a
connection in 30 seconds, none available[size:100; busy:100; idle:0;
lastwait:30000].
	at
org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:688)
	at
org.apache.tomcat.jdbc.pool.ConnectionPool.getConnection(ConnectionPool.java:187)
	at
org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:132)
	at
org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:90)
	at
org.apache.openejb.resource.jdbc.managed.local.ManagedConnection.newConnection(ManagedConnection.java:180)
	at
org.apache.openejb.resource.jdbc.managed.local.ManagedConnection.invoke(ManagedConnection.java:126)
	at com.sun.proxy.$Proxy101.prepareStatement(Unknown Source)
	at
org.hibernate.engine.jdbc.internal.StatementPreparerImpl$5.doPrepare(StatementPreparerImpl.java:159)
	at
org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:183)
	... 49 more

Thank you 



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/PoolExhaustedException-in-logs-tp4680034.html
Sent from the TomEE Dev mailing list archive at Nabble.com.

Re: PoolExhaustedException in logs

Posted by Romain Manni-Bucau <rm...@gmail.com>.
don't pass user/password to hibernate

hibernate needs to use datasource.getConnection() and not
datasource.getConnection(user, pwd)


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Wordpress Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2016-09-07 10:57 GMT+02:00 Dignesh <dg...@opentext.com>:

> Hi Romain,
>
> I have added the property in the resource. I am seeing a different issue
> now. Below is the stack trace what I am seeing in logs. Is there something
> I
> need to do additionally to switch to dbcp ?
>         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:494)
> Caused by: java.lang.UnsupportedOperationException: Not supported by
> BasicDataSource
>         at
> org.apache.commons.dbcp2.BasicDataSource.getConnection(
> BasicDataSource.java:1552)
>         at
> org.hibernate.service.jdbc.connections.internal.
> DatasourceConnectionProviderImpl.getConnection(
> DatasourceConnectionProviderImpl.java:141)
>         at
> org.hibernate.internal.AbstractSessionImpl$NonContextualJdbcConnectionAcc
> ess.obtainConnection(AbstractSessionImpl.java:301)
>         at
> org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.obtainConnection(
> LogicalConnectionImpl.java:214)
>         at
> org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.getConnection(
> LogicalConnectionImpl.java:157)
>         at
> org.hibernate.engine.jdbc.internal.StatementPreparerImpl.connection(
> StatementPreparerImpl.java:56)
>         at
> org.hibernate.engine.jdbc.internal.StatementPreparerImpl$5.doPrepare(
> StatementPreparerImpl.java:159)
>         at
> org.hibernate.engine.jdbc.internal.StatementPreparerImpl$
> StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:
> 183)
>         at
> org.hibernate.engine.jdbc.internal.StatementPreparerImpl.
> prepareQueryStatement(StatementPreparerImpl.java:157)
>         at org.hibernate.loader.Loader.prepareQueryStatement(Loader.
> java:1881)
>         at org.hibernate.loader.Loader.executeQueryStatement(Loader.
> java:1858)
>         at org.hibernate.loader.Loader.executeQueryStatement(Loader.
> java:1838)
>         at org.hibernate.loader.Loader.doQuery(Loader.java:906)
>         at
> org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCol
> lections(Loader.java:348)
>         at org.hibernate.loader.Loader.doList(Loader.java:2550)
>         at org.hibernate.loader.Loader.doList(Loader.java:2536)
>         at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.
> java:2366)
>         at org.hibernate.loader.Loader.list(Loader.java:2361)
>         at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:495)
>         at
> org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(
> QueryTranslatorImpl.java:357)
>         at
> org.hibernate.engine.query.spi.HQLQueryPlan.performList(
> HQLQueryPlan.java:198)
>         at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1194)
>         at org.hibernate.internal.QueryImpl.list(QueryImpl.java:101)
>
> Thank you,
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.n4.nabble.com/
> PoolExhaustedException-in-logs-tp4680034p4680041.html
> Sent from the TomEE Dev mailing list archive at Nabble.com.
>

Re: PoolExhaustedException in logs

Posted by Dignesh <dg...@opentext.com>.
Hi Romain,

I have added the property in the resource. I am seeing a different issue
now. Below is the stack trace what I am seeing in logs. Is there something I
need to do additionally to switch to dbcp ?
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:494)
Caused by: java.lang.UnsupportedOperationException: Not supported by
BasicDataSource
	at
org.apache.commons.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1552)
	at
org.hibernate.service.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:141)
	at
org.hibernate.internal.AbstractSessionImpl$NonContextualJdbcConnectionAccess.obtainConnection(AbstractSessionImpl.java:301)
	at
org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.obtainConnection(LogicalConnectionImpl.java:214)
	at
org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.getConnection(LogicalConnectionImpl.java:157)
	at
org.hibernate.engine.jdbc.internal.StatementPreparerImpl.connection(StatementPreparerImpl.java:56)
	at
org.hibernate.engine.jdbc.internal.StatementPreparerImpl$5.doPrepare(StatementPreparerImpl.java:159)
	at
org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:183)
	at
org.hibernate.engine.jdbc.internal.StatementPreparerImpl.prepareQueryStatement(StatementPreparerImpl.java:157)
	at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1881)
	at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1858)
	at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1838)
	at org.hibernate.loader.Loader.doQuery(Loader.java:906)
	at
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:348)
	at org.hibernate.loader.Loader.doList(Loader.java:2550)
	at org.hibernate.loader.Loader.doList(Loader.java:2536)
	at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2366)
	at org.hibernate.loader.Loader.list(Loader.java:2361)
	at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:495)
	at
org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:357)
	at
org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:198)
	at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1194)
	at org.hibernate.internal.QueryImpl.list(QueryImpl.java:101)

Thank you,



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/PoolExhaustedException-in-logs-tp4680034p4680041.html
Sent from the TomEE Dev mailing list archive at Nabble.com.

Re: PoolExhaustedException in logs

Posted by Romain Manni-Bucau <rm...@gmail.com>.
datasource properties = properties of the datasource = in <Resource> block


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Wordpress Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2016-09-06 15:44 GMT+02:00 Dignesh <dg...@opentext.com>:

> I dont see any property file with that name in tomee.
> Should I create one? and I should place in which location ?
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.n4.nabble.com/
> PoolExhaustedException-in-logs-tp4680034p4680038.html
> Sent from the TomEE Dev mailing list archive at Nabble.com.
>

Re: PoolExhaustedException in logs

Posted by Dignesh <dg...@opentext.com>.
I dont see any property file with that name in tomee.
Should I create one? and I should place in which location ?



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/PoolExhaustedException-in-logs-tp4680034p4680038.html
Sent from the TomEE Dev mailing list archive at Nabble.com.

Re: PoolExhaustedException in logs

Posted by Romain Manni-Bucau <rm...@gmail.com>.
only that line in datasource properties

(side note: should be fixed on master/next release)


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Wordpress Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2016-09-06 15:40 GMT+02:00 Dignesh <dg...@opentext.com>:

> Hi Romain,
>
> Is that something configurable in tomee.xml.
> "DataSourceCreator = dbcp."
> OR are there any additional changes need to be done to switch to dbcp ?
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.n4.nabble.com/
> PoolExhaustedException-in-logs-tp4680034p4680036.html
> Sent from the TomEE Dev mailing list archive at Nabble.com.
>

Re: PoolExhaustedException in logs

Posted by Dignesh <dg...@opentext.com>.
Hi Romain,

Is that something configurable in tomee.xml.
"DataSourceCreator = dbcp."
OR are there any additional changes need to be done to switch to dbcp ?



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/PoolExhaustedException-in-logs-tp4680034p4680036.html
Sent from the TomEE Dev mailing list archive at Nabble.com.

Re: PoolExhaustedException in logs

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi

we identified few cases where we can leak connection with this mode (JTA +
tomcat-jdbc), maybe try to switch to dbcp setting DataSourceCreator = dbcp.


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Wordpress Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2016-09-06 15:34 GMT+02:00 Dignesh <dg...@opentext.com>:

> Hi,
>
> My application is deployed on TomEE. It works fine for sometime, but after
> few hours I see these below exceptions in the log. Is the pool size is
> configurable in tomee.xml file.I do see few properties that can be
> specified
> for a resource in documentation, I am not sure which one is applicable for
> the below issue?Can some one please help me on this.
>
> Caused by: org.hibernate.exception.GenericJDBCException: could not prepare
> statement
>         at
> org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(
> StandardSQLExceptionConverter.java:54)
>         at
> org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(
> SqlExceptionHelper.java:124)
>         at
> org.hibernate.engine.jdbc.internal.StatementPreparerImpl$
> StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:
> 193)
>         at
> org.hibernate.engine.jdbc.internal.StatementPreparerImpl.
> prepareQueryStatement(StatementPreparerImpl.java:157)
>         at org.hibernate.loader.Loader.prepareQueryStatement(Loader.
> java:1881)
>         at org.hibernate.loader.Loader.executeQueryStatement(Loader.
> java:1858)
>         at org.hibernate.loader.Loader.executeQueryStatement(Loader.
> java:1838)
>         at org.hibernate.loader.Loader.doQuery(Loader.java:906)
>         at
> org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCol
> lections(Loader.java:348)
>         at org.hibernate.loader.Loader.doList(Loader.java:2550)
>         at org.hibernate.loader.Loader.doList(Loader.java:2536)
>         at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.
> java:2366)
>         at org.hibernate.loader.Loader.list(Loader.java:2361)
>         at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:495)
>         at
> org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(
> QueryTranslatorImpl.java:357)
>         at
> org.hibernate.engine.query.spi.HQLQueryPlan.performList(
> HQLQueryPlan.java:198)
>         at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1194)
>         at org.hibernate.internal.QueryImpl.list(QueryImpl.java:101)
>         at
> com.artesia.server.user.entity.UserStorageManager.retrieveTeamsUser(
> UserStorageManager.java:1700)
>         ... 33 more
> Caused by: org.apache.tomcat.jdbc.pool.PoolExhaustedException: [Default
> JMS
> Resource Adapter-worker- - 68] Timeout: Pool empty. Unable to fetch a
> connection in 30 seconds, none available[size:100; busy:100; idle:0;
> lastwait:30000].
>         at
> org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(
> ConnectionPool.java:688)
>         at
> org.apache.tomcat.jdbc.pool.ConnectionPool.getConnection(
> ConnectionPool.java:187)
>         at
> org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(
> DataSourceProxy.java:132)
>         at
> org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(
> DataSourceProxy.java:90)
>         at
> org.apache.openejb.resource.jdbc.managed.local.ManagedConnection.
> newConnection(ManagedConnection.java:180)
>         at
> org.apache.openejb.resource.jdbc.managed.local.ManagedConnection.invoke(
> ManagedConnection.java:126)
>         at com.sun.proxy.$Proxy101.prepareStatement(Unknown Source)
>         at
> org.hibernate.engine.jdbc.internal.StatementPreparerImpl$5.doPrepare(
> StatementPreparerImpl.java:159)
>         at
> org.hibernate.engine.jdbc.internal.StatementPreparerImpl$
> StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:
> 183)
>         ... 49 more
>
> Thank you
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.n4.nabble.com/
> PoolExhaustedException-in-logs-tp4680034.html
> Sent from the TomEE Dev mailing list archive at Nabble.com.
>