[1.2.4] Glassfish, Play, Connections problem

921 views
Skip to first unread message

Илья Скорик

unread,
Dec 19, 2011, 5:25:42 PM12/19/11
to play-framework
I have the following problem with Glasfish. Connections from the
Glassfish pull are passed through JNDI. After a while I get the
following error message. Probably Play not release session after
processing a request? What can I do?

Oops: PersistenceException
An unexpected error occured caused by exception PersistenceException:
org.hibernate.exception.GenericJDBCException: Cannot open connection

play.exceptions.UnexpectedException: Unexpected Error
at play.Invoker$Invocation.onException(Invoker.java:244)
at play.Invoker$Invocation.run(Invoker.java:286)
at play.server.ServletWrapper
$ServletInvocation.run(ServletWrapper.java:548)
at play.Invoker.invokeInThread(Invoker.java:68)
at play.server.ServletWrapper.service(ServletWrapper.java:142)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
at
org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:
1539)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:
281)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:
175)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:
655)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:
595)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)
at
com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:
91)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:
162)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:
655)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:
595)
at
org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:
327)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:
231)
at
com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:
174)
at
com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:
828)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:
725)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:
1019)
at
com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:
225)
at
com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:
137)
at
com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:
104)
at
com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:
90)
at
com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:
79)
at
com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:
54)
at
com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:
59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool
$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool
$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:662)
Caused by: javax.persistence.PersistenceException:
org.hibernate.exception.GenericJDBCException: Cannot open connection
at
org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:
1214)
at
org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:
1147)
at
org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:
1224)
at org.hibernate.ejb.TransactionImpl.begin(TransactionImpl.java:
63)
at play.db.jpa.JPAPlugin.startTx(JPAPlugin.java:350)
at play.db.jpa.JPAPlugin.beforeInvocation(JPAPlugin.java:318)
at
play.plugins.PluginCollection.beforeInvocation(PluginCollection.java:
428)
at play.Invoker$Invocation.before(Invoker.java:217)
at play.Invoker$Invocation.run(Invoker.java:277)
... 31 more
Caused by: org.hibernate.exception.GenericJDBCException: Cannot open
connection
at
org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:
140)
at
org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:
128)
at
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:
66)
at
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:
52)
at
org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:
449)
at
org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:
167)
at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:160)
at
org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:
81)
at
org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1473)
at org.hibernate.ejb.TransactionImpl.begin(TransactionImpl.java:
60)
... 36 more
Caused by: java.sql.SQLException: Error in allocating a connection.
Cause: In-use connections equal max-pool-size and expired max-wait-
time. Cannot allocate more connections.
at com.sun.gjc.spi.base.DataSource.getConnection(DataSource.java:
120)
at
org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider.getConnection(InjectedDataSourceConnectionProvider.java:
71)
at
org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:
446)
... 41 more
Caused by: javax.resource.spi.ResourceAllocationException: Error in
allocating a connection. Cause: In-use connections equal max-pool-size
and expired max-wait-time. Cannot allocate more connections.
at
com.sun.enterprise.connectors.ConnectionManagerImpl.internalGetConnection(ConnectionManagerImpl.java:
307)
at
com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:
190)
at
com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:
165)
at
com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:
160)
at com.sun.gjc.spi.base.DataSource.getConnection(DataSource.java:
113)
... 43 more
Caused by: com.sun.appserv.connectors.internal.api.PoolingException:
In-use connections equal max-pool-size and expired max-wait-time.
Cannot allocate more connections.
at
com.sun.enterprise.resource.pool.ConnectionPool.getResource(ConnectionPool.java:
418)
at
com.sun.enterprise.resource.pool.PoolManagerImpl.getResourceFromPool(PoolManagerImpl.java:
242)
at
com.sun.enterprise.resource.pool.PoolManagerImpl.getResource(PoolManagerImpl.java:
167)
at
com.sun.enterprise.connectors.ConnectionManagerImpl.getResource(ConnectionManagerImpl.java:
338)
at
com.sun.enterprise.connectors.ConnectionManagerImpl.internalGetConnection(ConnectionManagerImpl.java:
301)
... 47 more

Илья Скорик

unread,
Dec 21, 2011, 7:23:50 AM12/21/11
to play-framework
Bump?

Илья Скорик

unread,
Dec 22, 2011, 3:09:50 PM12/22/11
to play-framework
Someone?

2011/12/21 Илья Скорик <il...@skorik.me>
Bump?
--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To post to this group, send email to play-fr...@googlegroups.com.
To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.




--
С уважением, Илья Скорик
Yours faithfully, Ilya Skorik

Dominik Dorn

unread,
Dec 23, 2011, 5:08:40 AM12/23/11
to play-fr...@googlegroups.com
your pool ran out of connections.

try to decrease the wait-time and set connection leak detection to on.

http://docs.oracle.com/cd/E18930_01/html/821-2416/ggndx.html#gktdi



2011/12/22 Илья Скорик <il...@skorik.me>



--
Dominik Dorn
http://dominikdorn.com
http://twitter.com/domdorn

Skripten, Mitschriften, Lernunterlagen, etc. findest Du auf http://www.studyguru.eu !

Łukasz Radziwonowicz

unread,
Feb 22, 2012, 7:42:48 AM2/22/12
to play-fr...@googlegroups.com
I have the same problem, GlassFish/Play does not release connections. Did you found solution for this?

I'm trying to change connection pool settings, but I do not know which pool my Play App is using.

Connections from the Glassfish pull are passed through JNDI.
How did you configure this? (I know there is a bug in 1.2.4: https://groups.google.com/d/topic/play-framework/0tiHwOOI5Q0/discussion)

Thanks in advance!

Reply all
Reply to author
Forward
0 new messages