The problem comes up after a period of idleness, and is intermittent. As you can see from the stacktrace below, the error occurs right after getting a connection. There is an attempt to set auto_commit, but it appears the connection the pool gave us was closed.
Thank you for your prompt attention to this issue.
@6g5hhg1nb: Execution exception in null:null
at play.api.Application$class.handleError(Application.scala:293)
at play.api.DefaultApplication.handleError(Application.scala:399)
at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$12$$anonfun$apply$1.applyOrElse(PlayDefaultUpstreamHandler.scala:165)
at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$12$$anonfun$apply$1.applyOrElse(PlayDefaultUpstreamHandler.scala:162)
at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:33)
at scala.util.Failure$$anonfun$recover$1.apply(Try.scala:185)
at scala.util.Try$.apply(Try.scala:161)
at scala.util.Failure.recover(Try.scala:185)
at scala.concurrent.Future$$anonfun$recover$1.apply(Future.scala:387)
at scala.concurrent.Future$$anonfun$recover$1.apply(Future.scala:387)
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:29)
at play.api.libs.iteratee.Execution$$anon$1.execute(Execution.scala:43)
at scala.concurrent.impl.CallbackRunnable.executeWithValue(Promise.scala:37)
at scala.concurrent.impl.Promise$DefaultPromise.tryComplete(Promise.scala:133)
at scala.concurrent.Promise$class.complete(Promise.scala:55)
at scala.concurrent.impl.Promise$DefaultPromise.complete(Promise.scala:58)
at scala.concurrent.Future$$anonfun$flatMap$1$$anonfun$apply$3.apply(Future.scala:278)
at scala.concurrent.Future$$anonfun$flatMap$1$$anonfun$apply$3.apply(Future.scala:278)
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:29)
at scala.concurrent.Future$InternalCallbackExecutor$Batch$$anonfun$run$1.processBatch$1(Future.scala:731)
at scala.concurrent.Future$InternalCallbackExecutor$Batch$$anonfun$run$1.apply$mcV$sp(Future.scala:746)
at scala.concurrent.Future$InternalCallbackExecutor$Batch$$anonfun$run$1.apply(Future.scala:723)
at scala.concurrent.Future$InternalCallbackExecutor$Batch$$anonfun$run$1.apply(Future.scala:723)
at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:72)
at scala.concurrent.Future$InternalCallbackExecutor$Batch.run(Future.scala:722)
at scala.concurrent.Future$InternalCallbackExecutor$.scala$concurrent$Future$InternalCallbackExecutor$$unbatchedExecute(Future.scala:782)
at scala.concurrent.Future$InternalCallbackExecutor$.execute(Future.scala:773)
at scala.concurrent.impl.CallbackRunnable.executeWithValue(Promise.scala:37)
at scala.concurrent.impl.Promise$DefaultPromise.tryComplete(Promise.scala:133)
at scala.concurrent.Promise$class.complete(Promise.scala:55)
at scala.concurrent.impl.Promise$DefaultPromise.complete(Promise.scala:58)
at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:274)
at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:274)
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:29)
at play.api.libs.iteratee.Execution$$anon$2.execute(Execution.scala:70)
at scala.concurrent.impl.CallbackRunnable.executeWithValue(Promise.scala:37)
at scala.concurrent.impl.Promise$DefaultPromise.tryComplete(Promise.scala:133)
at scala.concurrent.Promise$class.complete(Promise.scala:55)
at scala.concurrent.impl.Promise$DefaultPromise.complete(Promise.scala:58)
at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:23)
at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:42)
at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:386)
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed.
at sun.reflect.GeneratedConstructorAccessor16.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.Util.getInstance(Util.java:386)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1015)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:989)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:975)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:920)
at com.mysql.jdbc.ConnectionImpl.throwConnectionClosedException(ConnectionImpl.java:1304)
at com.mysql.jdbc.ConnectionImpl.checkClosed(ConnectionImpl.java:1296)
at com.mysql.jdbc.ConnectionImpl.setAutoCommit(ConnectionImpl.java:5293)
at com.jolbox.bonecp.ConnectionHandle.setAutoCommit(ConnectionHandle.java:1292)
at play.api.db.BoneCPApi$$anon$1.onCheckOut(DB.scala:329)
at com.jolbox.bonecp.AbstractConnectionStrategy.postConnection(AbstractConnectionStrategy.java:75)
at com.jolbox.bonecp.AbstractConnectionStrategy.getConnection(AbstractConnectionStrategy.java:92)
at com.jolbox.bonecp.BoneCP.getConnection(BoneCP.java:553)
at com.jolbox.bonecp.BoneCPDataSource.getConnection(BoneCPDataSource.java:131)
at play.api.db.DBApi$class.getConnection(DB.scala:67)
at play.api.db.BoneCPApi.getConnection(DB.scala:276)
at play.api.db.DBApi$class.withConnection(DB.scala:80)
at play.api.db.BoneCPApi.withConnection(DB.scala:276)
at play.api.db.DB$$anonfun$withConnection$3.apply(DB.scala:162)
at play.api.db.DB$$anonfun$withConnection$3.apply(DB.scala:162)
at scala.Option.map(Option.scala:145)
at play.api.db.DB$.withConnection(DB.scala:162)
at models.Account$.getChildAccounts(Account.scala:160)
Hello,
I'm using BoneCP (0.8.0.RELEASE) as part of Play! 2.2.1, and I am having similar problems. My configuration is as follows:
db.default. driver= com.mysql. jdbc.Driver url="jdbc: mysql:/ /my-host/ database- name" user=user password= password
db.default.
db.default.
db.default.
The problem comes up after a period of idleness, and is intermittent. As you can see from the stacktrace below, the error occurs right after getting a connection. There is an attempt to set auto_commit, but it appears the connection the pool gave us was closed.
Thank you for your prompt attention to this issue.
@6g5hhg1nb: Execution exception in null:null Application$ class.handleErr or(Application. scala:293) DefaultApplicat ion.handleError (Application. scala:399) server. netty.PlayDefau ltUpstreamHandl er$$anonfun$ 12$$anonfun$ apply$1. applyOrElse( PlayDefaultUpst reamHandler. scala:165) server. netty.PlayDefau ltUpstreamHandl er$$anonfun$ 12$$anonfun$ apply$1. applyOrElse( PlayDefaultUpst reamHandler. scala:162) AbstractPartial Function. apply(AbstractP artialFunction. scala:33) Failure$ $anonfun$ recover$ 1.apply( Try.scala: 185) Try$.apply( Try.scala: 161) Failure. recover( Try.scala: 185) t.Future$ $anonfun$ recover$ 1.apply( Future. scala:387) t.Future$ $anonfun$ recover$ 1.apply( Future. scala:387) t.impl. CallbackRunnabl e.run(Promise. scala:29) libs.iteratee. Execution$ $anon$1. execute( Execution. scala:43) t.impl. CallbackRunnabl e.executeWithVa lue(Promise. scala:37) t.impl. Promise$ DefaultPromise. tryComplete( Promise. scala:133) t.Promise$ class.complete( Promise. scala:55) t.impl. Promise$ DefaultPromise. complete( Promise. scala:58) t.Future$ $anonfun$ flatMap$ 1$$anonfun$ apply$3. apply(Future. scala:278) t.Future$ $anonfun$ flatMap$ 1$$anonfun$ apply$3. apply(Future. scala:278) t.impl. CallbackRunnabl e.run(Promise. scala:29) t.Future$ InternalCallbac kExecutor$ Batch$$ anonfun$ run$1.processBa tch$1(Future. scala:731) t.Future$ InternalCallbac kExecutor$ Batch$$ anonfun$ run$1.apply$ mcV$sp( Future. scala:746) t.Future$ InternalCallbac kExecutor$ Batch$$ anonfun$ run$1.apply( Future. scala:723) t.Future$ InternalCallbac kExecutor$ Batch$$ anonfun$ run$1.apply( Future. scala:723) t.BlockContext$ .withBlockConte xt(BlockContext .scala: 72) t.Future$ InternalCallbac kExecutor$ Batch.run( Future. scala:722) t.Future$ InternalCallbac kExecutor$ .scala$ concurrent$ Future$ InternalCallbac kExecutor$ $unbatchedExecu te(Future. scala:782) t.Future$ InternalCallbac kExecutor$ .execute( Future. scala:773) t.impl. CallbackRunnabl e.executeWithVa lue(Promise. scala:37) t.impl. Promise$ DefaultPromise. tryComplete( Promise. scala:133) t.Promise$ class.complete( Promise. scala:55) t.impl. Promise$ DefaultPromise. complete( Promise. scala:58) t.Future$ $anonfun$ flatMap$ 1.apply( Future. scala:274) t.Future$ $anonfun$ flatMap$ 1.apply( Future. scala:274) t.impl. CallbackRunnabl e.run(Promise. scala:29) libs.iteratee. Execution$ $anon$2. execute( Execution. scala:70) t.impl. CallbackRunnabl e.executeWithVa lue(Promise. scala:37) t.impl. Promise$ DefaultPromise. tryComplete( Promise. scala:133) t.Promise$ class.complete( Promise. scala:55) t.impl. Promise$ DefaultPromise. complete( Promise. scala:58) t.impl. Future$ PromiseCompleti ngRunnable. run(Future. scala:23) TaskInvocation. run(AbstractDis patcher. scala:42) ForkJoinExecuto rConfigurator$ AkkaForkJoinTas k.exec( AbstractDispatc her.scala: 386) t.forkjoin. ForkJoinTask. doExec( ForkJoinTask. java:260) t.forkjoin. ForkJoinPool$ WorkQueue. runTask( ForkJoinPool. java:1339) t.forkjoin. ForkJoinPool. runWorker( ForkJoinPool. java:1979) t.forkjoin. ForkJoinWorkerT hread.run( ForkJoinWorkerT hread.java: 107) jdbc.exceptions .jdbc4. MySQLNonTransie ntConnectionExc eption: No operations allowed after connection closed. GeneratedConstr uctorAccessor16 .newInstance( Unknown Source) DelegatingConst ructorAccessorI mpl.newInstance (DelegatingCons tructorAccessor Impl.java: 45) reflect. Constructor. newInstance( Constructor. java:532) jdbc.Util. handleNewInstan ce(Util. java:411) jdbc.Util. getInstance( Util.java: 386) jdbc.SQLError. createSQLExcept ion(SQLError. java:1015) jdbc.SQLError. createSQLExcept ion(SQLError. java:989) jdbc.SQLError. createSQLExcept ion(SQLError. java:975) jdbc.SQLError. createSQLExcept ion(SQLError. java:920) jdbc.Connection Impl.throwConne ctionClosedExce ption(Connectio nImpl.java: 1304) jdbc.Connection Impl.checkClose d(ConnectionImp l.java: 1296) jdbc.Connection Impl.setAutoCom mit(ConnectionI mpl.java: 5293) bonecp. ConnectionHandl e.setAutoCommit (ConnectionHand le.java: 1292) db.BoneCPApi$ $anon$1. onCheckOut( DB.scala: 329) bonecp. AbstractConnect ionStrategy. postConnection( AbstractConnect ionStrategy. java:75) bonecp. AbstractConnect ionStrategy. getConnection( AbstractConnect ionStrategy. java:92) bonecp. BoneCP. getConnection( BoneCP. java:553) bonecp. BoneCPDataSourc e.getConnection (BoneCPDataSour ce.java: 131) db.DBApi$ class.getConnec tion(DB. scala:67) db.BoneCPApi. getConnection( DB.scala: 276) db.DBApi$ class.withConne ction(DB. scala:80) db.BoneCPApi. withConnection( DB.scala: 276) db.DB$$ anonfun$ withConnection$ 3.apply( DB.scala: 162) db.DB$$ anonfun$ withConnection$ 3.apply( DB.scala: 162) map(Option. scala:145) db.DB$. withConnection( DB.scala: 162) Account$ .getChildAccoun ts(Account. scala:160)
at play.api.
at play.api.
at play.core.
at play.core.
at scala.runtime.
at scala.util.
at scala.util.
at scala.util.
at scala.concurren
at scala.concurren
at scala.concurren
at play.api.
at scala.concurren
at scala.concurren
at scala.concurren
at scala.concurren
at scala.concurren
at scala.concurren
at scala.concurren
at scala.concurren
at scala.concurren
at scala.concurren
at scala.concurren
at scala.concurren
at scala.concurren
at scala.concurren
at scala.concurren
at scala.concurren
at scala.concurren
at scala.concurren
at scala.concurren
at scala.concurren
at scala.concurren
at scala.concurren
at play.api.
at scala.concurren
at scala.concurren
at scala.concurren
at scala.concurren
at scala.concurren
at akka.dispatch.
at akka.dispatch.
at scala.concurren
at scala.concurren
at scala.concurren
at scala.concurren
Caused by: com.mysql.
at sun.reflect.
at sun.reflect.
at java.lang.
at com.mysql.
at com.mysql.
at com.mysql.
at com.mysql.
at com.mysql.
at com.mysql.
at com.mysql.
at com.mysql.
at com.mysql.
at com.jolbox.
at play.api.
at com.jolbox.
at com.jolbox.
at com.jolbox.
at com.jolbox.
at play.api.
at play.api.
at play.api.
at play.api.
at play.api.
at play.api.
at scala.Option.
at play.api.
at models.