使用 Slick 3.1 和 PlayFramework 2.5 Scala 进行进化时超时
Timeout when making an evolution with Slick 3.1 and PlayFramework 2.5 Scala
我目前正在开发一个 WebApp,以提高我在 Play Framework 和 Scala 方面的技能。
我已经学习了这个教程:http://pedrorijo.com/blog/play-slick/
我已将代码调整到我的用户对象(更改字段),但在全球范围内这与最终结果相同 (https://github.com/nemoo/play-slick3-example) 我还通过克隆 repo.The 来重现它唯一可能不同的是我正在使用 RDS 数据库来测试我的代码。
当我在没有 1.sql 的情况下启动索引页面时,它无法正常工作,这是正常的,它向我显示错误,提示 table 用户丢失
当我用 sequel pro 手动添加数据库中的 table 时,一切正常
但是,当我尝试通过 play-evolution 创建它时,出现了这个错误:
java.sql.SQLTimeoutException: Timeout after 1004ms of waiting for a connection.
com.zaxxer.hikari.pool.BaseHikariPool.getConnection(BaseHikariPool.java:227)
com.zaxxer.hikari.pool.BaseHikariPool.getConnection(BaseHikariPool.java:182)
com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:93)
slick.jdbc.hikaricp.HikariCPJdbcDataSource.createConnection(HikariCPJdbcDataSource.scala:12)
play.api.db.slick.evolutions.internal.DBApiAdapter$DatabaseAdapter.getConnection(DBApiAdapter.scala:57)
play.api.db.slick.evolutions.internal.DBApiAdapter$DatabaseAdapter.getConnection(DBApiAdapter.scala:60)
play.api.db.evolutions.DatabaseEvolutions.databaseEvolutions(EvolutionsApi.scala:124)
play.api.db.evolutions.DatabaseEvolutions.scripts(EvolutionsApi.scala:102)
play.api.db.evolutions.DatabaseEvolutions.scripts(EvolutionsApi.scala:117)
play.api.db.evolutions.DefaultEvolutionsApi.scripts(EvolutionsApi.scala:82)
play.api.db.evolutions.ApplicationEvolutions$$anonfun$play$api$db$evolutions$ApplicationEvolutions$$runEvolutions.apply$mcV$sp(ApplicationEvolutions.scala:53)
play.api.db.evolutions.ApplicationEvolutions.withLock(ApplicationEvolutions.scala:99)
play.api.db.evolutions.ApplicationEvolutions.play$api$db$evolutions$ApplicationEvolutions$$runEvolutions(ApplicationEvolutions.scala:49)
play.api.db.evolutions.ApplicationEvolutions$$anonfun$start.apply(ApplicationEvolutions.scala:42)
play.api.db.evolutions.ApplicationEvolutions$$anonfun$start.apply(ApplicationEvolutions.scala:42)
scala.collection.immutable.Stream.foreach(Stream.scala:594)
play.api.db.evolutions.ApplicationEvolutions.start(ApplicationEvolutions.scala:42)
play.api.db.evolutions.ApplicationEvolutions.<init>(ApplicationEvolutions.scala:150)
play.api.db.evolutions.ApplicationEvolutionsProvider.get$lzycompute(EvolutionsModule.scala:53)
play.api.db.evolutions.ApplicationEvolutionsProvider.get(EvolutionsModule.scala:53)
play.api.db.evolutions.ApplicationEvolutionsProvider.get(EvolutionsModule.scala:44)
com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:81)
com.google.inject.internal.BoundProviderFactory.provision(BoundProviderFactory.java:72)
com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:61)
com.google.inject.internal.BoundProviderFactory.get(BoundProviderFactory.java:62)
com.google.inject.internal.ProviderToInternalFactoryAdapter.call(ProviderToInternalFactoryAdapter.java:46)
com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103)
com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
com.google.inject.internal.SingletonScope.get(SingletonScope.java:145)
com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
com.google.inject.internal.InternalInjectorCreator.call(InternalInjectorCreator.java:205)
com.google.inject.internal.InternalInjectorCreator.call(InternalInjectorCreator.java:199)
com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
com.google.inject.internal.InternalInjectorCreator.loadEagerSingletons(InternalInjectorCreator.java:199)
com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:180)
com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:110)
com.google.inject.Guice.createInjector(Guice.java:96)
com.google.inject.Guice.createInjector(Guice.java:84)
play.api.inject.guice.GuiceBuilder.injector(GuiceInjectorBuilder.scala:181)
play.api.inject.guice.GuiceApplicationBuilder.build(GuiceApplicationBuilder.scala:123)
play.api.inject.guice.GuiceApplicationLoader.load(GuiceApplicationLoader.scala:21)
play.core.server.DevServerStart$$anonfun$mainDev$$anon$$anonfun$get$$anonfun$apply$$anonfun$$anonfun.apply(DevServerStart.scala:168)
play.core.server.DevServerStart$$anonfun$mainDev$$anon$$anonfun$get$$anonfun$apply$$anonfun$$anonfun.apply(DevServerStart.scala:164)
play.utils.Threads$.withContextClassLoader(Threads.scala:21)
play.core.server.DevServerStart$$anonfun$mainDev$$anon$$anonfun$get$$anonfun$apply$$anonfun.apply(DevServerStart.scala:164)
play.core.server.DevServerStart$$anonfun$mainDev$$anon$$anonfun$get$$anonfun$apply$$anonfun.apply(DevServerStart.scala:131)
scala.Option.map(Option.scala:146)
play.core.server.DevServerStart$$anonfun$mainDev$$anon$$anonfun$get$$anonfun$apply.apply(DevServerStart.scala:131)
play.core.server.DevServerStart$$anonfun$mainDev$$anon$$anonfun$get$$anonfun$apply.apply(DevServerStart.scala:129)
scala.util.Success.flatMap(Try.scala:231)
play.core.server.DevServerStart$$anonfun$mainDev$$anon$$anonfun$get.apply(DevServerStart.scala:129)
play.core.server.DevServerStart$$anonfun$mainDev$$anon$$anonfun$get.apply(DevServerStart.scala:121)
scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1(Future.scala:24)
scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24)
java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1402)
java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1689)
java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
我不知道为什么在手动完成时一切正常时我会超时。感谢所有帮助我的人!
那只是 Amazon RDS 实例的安全组问题,打开 3306 端口解决了问题:)
我目前正在开发一个 WebApp,以提高我在 Play Framework 和 Scala 方面的技能。
我已经学习了这个教程:http://pedrorijo.com/blog/play-slick/
我已将代码调整到我的用户对象(更改字段),但在全球范围内这与最终结果相同 (https://github.com/nemoo/play-slick3-example) 我还通过克隆 repo.The 来重现它唯一可能不同的是我正在使用 RDS 数据库来测试我的代码。
当我在没有 1.sql 的情况下启动索引页面时,它无法正常工作,这是正常的,它向我显示错误,提示 table 用户丢失
当我用 sequel pro 手动添加数据库中的 table 时,一切正常
但是,当我尝试通过 play-evolution 创建它时,出现了这个错误:
java.sql.SQLTimeoutException: Timeout after 1004ms of waiting for a connection.
com.zaxxer.hikari.pool.BaseHikariPool.getConnection(BaseHikariPool.java:227)
com.zaxxer.hikari.pool.BaseHikariPool.getConnection(BaseHikariPool.java:182)
com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:93)
slick.jdbc.hikaricp.HikariCPJdbcDataSource.createConnection(HikariCPJdbcDataSource.scala:12)
play.api.db.slick.evolutions.internal.DBApiAdapter$DatabaseAdapter.getConnection(DBApiAdapter.scala:57)
play.api.db.slick.evolutions.internal.DBApiAdapter$DatabaseAdapter.getConnection(DBApiAdapter.scala:60)
play.api.db.evolutions.DatabaseEvolutions.databaseEvolutions(EvolutionsApi.scala:124)
play.api.db.evolutions.DatabaseEvolutions.scripts(EvolutionsApi.scala:102)
play.api.db.evolutions.DatabaseEvolutions.scripts(EvolutionsApi.scala:117)
play.api.db.evolutions.DefaultEvolutionsApi.scripts(EvolutionsApi.scala:82)
play.api.db.evolutions.ApplicationEvolutions$$anonfun$play$api$db$evolutions$ApplicationEvolutions$$runEvolutions.apply$mcV$sp(ApplicationEvolutions.scala:53)
play.api.db.evolutions.ApplicationEvolutions.withLock(ApplicationEvolutions.scala:99)
play.api.db.evolutions.ApplicationEvolutions.play$api$db$evolutions$ApplicationEvolutions$$runEvolutions(ApplicationEvolutions.scala:49)
play.api.db.evolutions.ApplicationEvolutions$$anonfun$start.apply(ApplicationEvolutions.scala:42)
play.api.db.evolutions.ApplicationEvolutions$$anonfun$start.apply(ApplicationEvolutions.scala:42)
scala.collection.immutable.Stream.foreach(Stream.scala:594)
play.api.db.evolutions.ApplicationEvolutions.start(ApplicationEvolutions.scala:42)
play.api.db.evolutions.ApplicationEvolutions.<init>(ApplicationEvolutions.scala:150)
play.api.db.evolutions.ApplicationEvolutionsProvider.get$lzycompute(EvolutionsModule.scala:53)
play.api.db.evolutions.ApplicationEvolutionsProvider.get(EvolutionsModule.scala:53)
play.api.db.evolutions.ApplicationEvolutionsProvider.get(EvolutionsModule.scala:44)
com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:81)
com.google.inject.internal.BoundProviderFactory.provision(BoundProviderFactory.java:72)
com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:61)
com.google.inject.internal.BoundProviderFactory.get(BoundProviderFactory.java:62)
com.google.inject.internal.ProviderToInternalFactoryAdapter.call(ProviderToInternalFactoryAdapter.java:46)
com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103)
com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
com.google.inject.internal.SingletonScope.get(SingletonScope.java:145)
com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
com.google.inject.internal.InternalInjectorCreator.call(InternalInjectorCreator.java:205)
com.google.inject.internal.InternalInjectorCreator.call(InternalInjectorCreator.java:199)
com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
com.google.inject.internal.InternalInjectorCreator.loadEagerSingletons(InternalInjectorCreator.java:199)
com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:180)
com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:110)
com.google.inject.Guice.createInjector(Guice.java:96)
com.google.inject.Guice.createInjector(Guice.java:84)
play.api.inject.guice.GuiceBuilder.injector(GuiceInjectorBuilder.scala:181)
play.api.inject.guice.GuiceApplicationBuilder.build(GuiceApplicationBuilder.scala:123)
play.api.inject.guice.GuiceApplicationLoader.load(GuiceApplicationLoader.scala:21)
play.core.server.DevServerStart$$anonfun$mainDev$$anon$$anonfun$get$$anonfun$apply$$anonfun$$anonfun.apply(DevServerStart.scala:168)
play.core.server.DevServerStart$$anonfun$mainDev$$anon$$anonfun$get$$anonfun$apply$$anonfun$$anonfun.apply(DevServerStart.scala:164)
play.utils.Threads$.withContextClassLoader(Threads.scala:21)
play.core.server.DevServerStart$$anonfun$mainDev$$anon$$anonfun$get$$anonfun$apply$$anonfun.apply(DevServerStart.scala:164)
play.core.server.DevServerStart$$anonfun$mainDev$$anon$$anonfun$get$$anonfun$apply$$anonfun.apply(DevServerStart.scala:131)
scala.Option.map(Option.scala:146)
play.core.server.DevServerStart$$anonfun$mainDev$$anon$$anonfun$get$$anonfun$apply.apply(DevServerStart.scala:131)
play.core.server.DevServerStart$$anonfun$mainDev$$anon$$anonfun$get$$anonfun$apply.apply(DevServerStart.scala:129)
scala.util.Success.flatMap(Try.scala:231)
play.core.server.DevServerStart$$anonfun$mainDev$$anon$$anonfun$get.apply(DevServerStart.scala:129)
play.core.server.DevServerStart$$anonfun$mainDev$$anon$$anonfun$get.apply(DevServerStart.scala:121)
scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1(Future.scala:24)
scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24)
java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1402)
java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1689)
java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
我不知道为什么在手动完成时一切正常时我会超时。感谢所有帮助我的人!
那只是 Amazon RDS 实例的安全组问题,打开 3306 端口解决了问题:)