播放,Ebeans:启动具有多个数据库的应用程序时出现 NullPointerException
Play, Ebeans: NullPointerException when starting application with multiple DBs
我在尝试启动需要能够连接到两个数据库(一个具有实体的主数据库,另一个具有与说的实体)。我的项目结构如下。
在我的 build.sbt 中,我有以下行
playEbeanModels in Compile := Seq("models.sentinel.*", "models.kodi.*")
在我的 application.conf 中,我有以下指向包含实体
的包
ebean.sentinel = ["models.sentinel.*"]
ebean.kodi = ["models.kodi.*"]
并这样配置数据源
db {
sentinel {
hikaricp {
dataSourceClassName = "com.mysql.jdbc.jdbc2.optional.MysqlDataSource"
maxLifetime=900000
idleTimeout=300000
maximumPoolSize=100
minimumIdle=5
username = sentinel
password = sentinelAdmin
dataSource {
user = *******
password = "*************"
databaseName = "sentinel"
serverName = "**********"
portNumber = 3306
interactiveClient=true
useUnicode=true
autoReconnect=true
prepStmtCacheSqlLimit=2048
cachePrepStmts=true
prepStmtCacheSize=250
useServerPrepStmts=true
}
}
}
kodi {
hikaricp {
dataSourceClassName = "com.mysql.jdbc.jdbc2.optional.MysqlDataSource"
maxLifetime=900000
idleTimeout=300000
maximumPoolSize=100
minimumIdle=5
username = kodi
password = kodiAdmin
dataSource {
user = ******
password = "********"
databaseName = "kodi"
serverName = "********"
portNumber = 3306
interactiveClient=true
useUnicode=true
autoReconnect=true
prepStmtCacheSqlLimit=2048
cachePrepStmts=true
prepStmtCacheSize=250
useServerPrepStmts=true
}
}
}
}
当我尝试编译并跟踪堆栈跟踪(截断以适合)时
[info] Babel compiling on 10 source(s)
[warn] application - Logger configuration in conf files is deprecated and has no effect. Use a logback configuration file instead.
[info] application - Creating Pool for datasource 'sentinel'
[info] p.a.d.DefaultDBApi - Database [sentinel] connected at jdbc:mysql://*********:3306/sentinel
[info] application - Creating Pool for datasource 'kodi'
[info] p.a.d.DefaultDBApi - Database [kodi] connected at jdbc:mysql://*********:3306/kodi
[error] i.e.s.d.BeanDescriptorManager - Error in deployment
java.lang.NullPointerException: null
at io.ebeanservice.docstore.api.support.DocStoreBeanBaseAdapter.derive(DocStoreBeanBaseAdapter.java:323)
at io.ebeanservice.docstore.api.support.DocStoreBeanBaseAdapter.<init>(DocStoreBeanBaseAdapter.java:110)
at io.ebeanservice.docstore.none.NoneDocStoreBeanAdapter.<init>(NoneDocStoreBeanAdapter.java:17)
at io.ebeanservice.docstore.none.NoneDocStoreFactory.createAdapter(NoneDocStoreFactory.java:24)
at io.ebeaninternal.server.deploy.BeanDescriptorManager.createDocStoreBeanAdapter(BeanDescriptorManager.java:260)
at io.ebeaninternal.server.deploy.BeanDescriptor.<init>(BeanDescriptor.java:491)
at io.ebeaninternal.server.deploy.BeanDescriptorManager.readEntityRelationships(BeanDescriptorManager.java:761)
at io.ebeaninternal.server.deploy.BeanDescriptorManager.deploy(BeanDescriptorManager.java:323)
at io.ebeaninternal.server.core.InternalConfiguration.<init>(InternalConfiguration.java:141)
at io.ebeaninternal.server.core.DefaultContainer.createServer(DefaultContainer.java:127)
[error] i.e.s.d.BeanDescriptorManager - Error in deployment
java.lang.NullPointerException: null
at io.ebeanservice.docstore.api.support.DocStoreBeanBaseAdapter.derive(DocStoreBeanBaseAdapter.java:323)
at io.ebeanservice.docstore.api.support.DocStoreBeanBaseAdapter.<init>(DocStoreBeanBaseAdapter.java:110)
at io.ebeanservice.docstore.none.NoneDocStoreBeanAdapter.<init>(NoneDocStoreBeanAdapter.java:17)
at io.ebeanservice.docstore.none.NoneDocStoreFactory.createAdapter(NoneDocStoreFactory.java:24)
at io.ebeaninternal.server.deploy.BeanDescriptorManager.createDocStoreBeanAdapter(BeanDescriptorManager.java:260)
at io.ebeaninternal.server.deploy.BeanDescriptor.<init>(BeanDescriptor.java:491)
at io.ebeaninternal.server.deploy.BeanDescriptorManager.readEntityRelationships(BeanDescriptorManager.java:761)
at io.ebeaninternal.server.deploy.BeanDescriptorManager.deploy(BeanDescriptorManager.java:323)
at io.ebeaninternal.server.core.InternalConfiguration.<init>(InternalConfiguration.java:141)
at io.ebeaninternal.server.core.DefaultContainer.createServer(DefaultContainer.java:127)
[info] application - ApplicationTimer demo: Starting application at 2017-03-29T13:44:16.602Z
[error] application -
! @73fn6o32j - Internal server error, for (GET) [/] ->
play.api.UnexpectedException: Unexpected exception[CreationException: Unable to create injector, see the following errors:
1) Error injecting constructor, java.lang.NullPointerException
at play.db.ebean.EbeanDynamicEvolutions.<init>(EbeanDynamicEvolutions.java:35)
at play.db.ebean.EbeanDynamicEvolutions.class(EbeanDynamicEvolutions.java:32)
while locating play.db.ebean.EbeanDynamicEvolutions
at play.db.ebean.EbeanModule.bindings(EbeanModule.java:21):
Binding(class play.api.db.evolutions.DynamicEvolutions to ConstructionTarget(class play.db.ebean.EbeanDynamicEvolutions) eagerly) (via modules: com.google.inject.util.Modules$OverrideModule -> play.api.inject.guice.GuiceableModuleConversions$$anon)
while locating play.api.db.evolutions.DynamicEvolutions
while locating play.api.db.evolutions.ApplicationEvolutionsProvider
at play.api.db.evolutions.EvolutionsModule.<init>(EvolutionsModule.scala:20):
Binding(class play.api.db.evolutions.ApplicationEvolutions to ProviderConstructionTarget(class play.api.db.evolutions.ApplicationEvolutionsProvider) eagerly) (via modules: com.google.inject.util.Modules$OverrideModule -> play.api.inject.guice.GuiceableModuleConversions$$anon)
while locating play.api.db.evolutions.ApplicationEvolutions
Caused by: java.lang.NullPointerException
at io.ebeanservice.docstore.api.support.DocStoreBeanBaseAdapter.derive(DocStoreBeanBaseAdapter.java:323)
at io.ebeanservice.docstore.api.support.DocStoreBeanBaseAdapter.<init>(DocStoreBeanBaseAdapter.java:110)
..............................
at io.ebean.EbeanServerFactory.createInternal(EbeanServerFactory.java:108)
at io.ebean.EbeanServerFactory.create(EbeanServerFactory.java:67)
at play.db.ebean.EbeanDynamicEvolutions.lambda$start(EbeanDynamicEvolutions.java:49)
at java.util.HashMap.forEach(HashMap.java:1288)
at play.db.ebean.EbeanDynamicEvolutions.start(EbeanDynamicEvolutions.java:49)
at play.db.ebean.EbeanDynamicEvolutions.<init>(EbeanDynamicEvolutions.java:38)
at play.db.ebean.EbeanDynamicEvolutions$$FastClassByGuice$c94231.newInstance(<generated>)
at com.google.inject.internal.DefaultConstructionProxyFactory$FastClassProxy.newInstance(DefaultConstructionProxyFactory.java:89)
..............................
at com.google.inject.internal.InjectorImpl.get(InjectorImpl.java:1015)
at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1054)
at play.api.inject.guice.GuiceInjector.instanceOf(GuiceInjectorBuilder.scala:405)
at play.api.inject.guice.GuiceInjector.instanceOf(GuiceInjectorBuilder.scala:400)
at play.api.db.evolutions.ApplicationEvolutionsProvider.get$lzycompute(EvolutionsModule.scala:49)
at play.api.db.evolutions.ApplicationEvolutionsProvider.get(EvolutionsModule.scala:49)
at play.api.db.evolutions.ApplicationEvolutionsProvider.get(EvolutionsModule.scala:40)
at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:81)
at com.google.inject.internal.BoundProviderFactory.provision(BoundProviderFactory.java:72)
at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:61)
at com.google.inject.internal.BoundProviderFactory.get(BoundProviderFactory.java:62)
..............................
at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:180)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:110)
at com.google.inject.Guice.createInjector(Guice.java:99)
at com.google.inject.Guice.createInjector(Guice.java:84)
at play.api.inject.guice.GuiceBuilder.injector(GuiceInjectorBuilder.scala:181)
at play.api.inject.guice.GuiceApplicationBuilder.build(GuiceApplicationBuilder.scala:137)
..............................
at play.core.server.DevServerStart$$anonfun$mainDev$$anon$$anonfun$get.apply(DevServerStart.scala:126)
at play.core.server.DevServerStart$$anonfun$mainDev$$anon$$anonfun$get.apply(DevServerStart.scala:118)
at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1(Future.scala:24)
at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24)
at scala.concurrent.impl.ExecutionContextImpl$AdaptedForkJoinTask.exec(ExecutionContextImpl.scala:121)
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)
2) Error injecting constructor, java.lang.NullPointerException
at play.db.ebean.EbeanDynamicEvolutions.<init>(EbeanDynamicEvolutions.java:35)
at play.db.ebean.EbeanDynamicEvolutions.class(EbeanDynamicEvolutions.java:32)
while locating play.db.ebean.EbeanDynamicEvolutions
at play.db.ebean.EbeanModule.bindings(EbeanModule.java:21):
Binding(class play.api.db.evolutions.DynamicEvolutions to ConstructionTarget(class play.db.ebean.EbeanDynamicEvolutions) eagerly) (via modules: com.google.inject.util.Modules$OverrideModule -> play.api.inject.guice.GuiceableModuleConversions$$anon)
while locating play.api.db.evolutions.DynamicEvolutions
Caused by: java.lang.NullPointerException
at io.ebeanservice.docstore.api.support.DocStoreBeanBaseAdapter.derive(DocStoreBeanBaseAdapter.java:323)
at io.ebeanservice.docstore.api.support.DocStoreBeanBaseAdapter.<init>(DocStoreBeanBaseAdapter.java:110)
..............................
at io.ebeaninternal.server.core.DefaultContainer.createServer(DefaultContainer.java:127)
at io.ebeaninternal.server.core.DefaultContainer.createServer(DefaultContainer.java:44)
at io.ebean.EbeanServerFactory.createInternal(EbeanServerFactory.java:108)
at io.ebean.EbeanServerFactory.create(EbeanServerFactory.java:67)
at play.db.ebean.EbeanDynamicEvolutions.lambda$start(EbeanDynamicEvolutions.java:49)
at java.util.HashMap.forEach(HashMap.java:1288)
at play.db.ebean.EbeanDynamicEvolutions.start(EbeanDynamicEvolutions.java:49)
at play.db.ebean.EbeanDynamicEvolutions.<init>(EbeanDynamicEvolutions.java:38)
at play.db.ebean.EbeanDynamicEvolutions$$FastClassByGuice$c94231.newInstance(<generated>)
at com.google.inject.internal.DefaultConstructionProxyFactory$FastClassProxy.newInstance(DefaultConstructionProxyFactory.java:89)
at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:111)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:90)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:268)
..............................
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:110)
at com.google.inject.Guice.createInjector(Guice.java:99)
at com.google.inject.Guice.createInjector(Guice.java:84)
at play.api.inject.guice.GuiceBuilder.injector(GuiceInjectorBuilder.scala:181)
at play.api.inject.guice.GuiceApplicationBuilder.build(GuiceApplicationBuilder.scala:137)
..............................
at scala.concurrent.impl.ExecutionContextImpl$AdaptedForkJoinTask.exec(ExecutionContextImpl.scala:121)
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)
2 errors]
at play.core.server.DevServerStart$$anonfun$mainDev$$anon$$anonfun$get$$anonfun$apply$$anonfun.apply(DevServerStart.scala:178)
at play.core.server.DevServerStart$$anonfun$mainDev$$anon$$anonfun$get$$anonfun$apply$$anonfun.apply(DevServerStart.scala:128)
at scala.Option.map(Option.scala:146)
at play.core.server.DevServerStart$$anonfun$mainDev$$anon$$anonfun$get$$anonfun$apply.apply(DevServerStart.scala:128)
at play.core.server.DevServerStart$$anonfun$mainDev$$anon$$anonfun$get$$anonfun$apply.apply(DevServerStart.scala:126)
at scala.util.Success.flatMap(Try.scala:231)
at play.core.server.DevServerStart$$anonfun$mainDev$$anon$$anonfun$get.apply(DevServerStart.scala:126)
at play.core.server.DevServerStart$$anonfun$mainDev$$anon$$anonfun$get.apply(DevServerStart.scala:118)
at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1(Future.scala:24)
at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24)
Caused by: com.google.inject.CreationException: Unable to create injector, see the following errors:
1) Error injecting constructor, java.lang.NullPointerException
at play.db.ebean.EbeanDynamicEvolutions.<init>(EbeanDynamicEvolutions.java:35)
at play.db.ebean.EbeanDynamicEvolutions.class(EbeanDynamicEvolutions.java:32)
while locating play.db.ebean.EbeanDynamicEvolutions
at play.db.ebean.EbeanModule.bindings(EbeanModule.java:21):
Binding(class play.api.db.evolutions.DynamicEvolutions to ConstructionTarget(class play.db.ebean.EbeanDynamicEvolutions) eagerly) (via modules: com.google.inject.util.Modules$OverrideModule -> play.api.inject.guice.GuiceableModuleConversions$$anon)
while locating play.api.db.evolutions.DynamicEvolutions
while locating play.api.db.evolutions.ApplicationEvolutionsProvider
at play.api.db.evolutions.EvolutionsModule.<init>(EvolutionsModule.scala:20):
Binding(class play.api.db.evolutions.ApplicationEvolutions to ProviderConstructionTarget(class play.api.db.evolutions.ApplicationEvolutionsProvider) eagerly) (via modules: com.google.inject.util.Modules$OverrideModule -> play.api.inject.guice.GuiceableModuleConversions$$anon)
while locating play.api.db.evolutions.ApplicationEvolutions
Caused by: java.lang.NullPointerException
at io.ebeanservice.docstore.api.support.DocStoreBeanBaseAdapter.derive(DocStoreBeanBaseAdapter.java:323)
at io.ebeanservice.docstore.api.support.DocStoreBeanBaseAdapter.<init>(DocStoreBeanBaseAdapter.java:110)
at io.ebeanservice.docstore.none.NoneDocStoreBeanAdapter.<init>(NoneDocStoreBeanAdapter.java:17)
..............................
at io.ebeaninternal.server.core.InternalConfiguration.<init>(InternalConfiguration.java:141)
at io.ebeaninternal.server.core.DefaultContainer.createServer(DefaultContainer.java:127)
at io.ebeaninternal.server.core.DefaultContainer.createServer(DefaultContainer.java:44)
at io.ebean.EbeanServerFactory.createInternal(EbeanServerFactory.java:108)
at io.ebean.EbeanServerFactory.create(EbeanServerFactory.java:67)
at play.db.ebean.EbeanDynamicEvolutions.lambda$start(EbeanDynamicEvolutions.java:49)
at java.util.HashMap.forEach(HashMap.java:1288)
at play.db.ebean.EbeanDynamicEvolutions.start(EbeanDynamicEvolutions.java:49)
at play.db.ebean.EbeanDynamicEvolutions.<init>(EbeanDynamicEvolutions.java:38)
at play.db.ebean.EbeanDynamicEvolutions$$FastClassByGuice$c94231.newInstance(<generated>)
at com.google.inject.internal.DefaultConstructionProxyFactory$FastClassProxy.newInstance(DefaultConstructionProxyFactory.java:89)
at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:111)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:90)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:268)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.call(ProviderToInternalFactoryAdapter.java:46)
..............................
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
at com.google.inject.internal.InjectorImpl.get(InjectorImpl.java:1015)
at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1054)
at play.api.inject.guice.GuiceInjector.instanceOf(GuiceInjectorBuilder.scala:405)
at play.api.inject.guice.GuiceInjector.instanceOf(GuiceInjectorBuilder.scala:400)
at play.api.db.evolutions.ApplicationEvolutionsProvider.get$lzycompute(EvolutionsModule.scala:49)
at play.api.db.evolutions.ApplicationEvolutionsProvider.get(EvolutionsModule.scala:49)
at play.api.db.evolutions.ApplicationEvolutionsProvider.get(EvolutionsModule.scala:40)
at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:81)
at com.google.inject.internal.BoundProviderFactory.provision(BoundProviderFactory.java:72)
..............................
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1085)
at com.google.inject.internal.InternalInjectorCreator.loadEagerSingletons(InternalInjectorCreator.java:199)
at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:180)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:110)
at com.google.inject.Guice.createInjector(Guice.java:99)
at com.google.inject.Guice.createInjector(Guice.java:84)
at play.api.inject.guice.GuiceBuilder.injector(GuiceInjectorBuilder.scala:181)
at play.api.inject.guice.GuiceApplicationBuilder.build(GuiceApplicationBuilder.scala:137)
at play.api.inject.guice.GuiceApplicationLoader.load(GuiceApplicationLoader.scala:21)
at play.core.server.DevServerStart$$anonfun$mainDev$$anon$$anonfun$get$$anonfun$apply$$anonfun$$anonfun.apply(DevServerStart.scala:166)
at play.core.server.DevServerStart$$anonfun$mainDev$$anon$$anonfun$get$$anonfun$apply$$anonfun$$anonfun.apply(DevServerStart.scala:163)
at play.utils.Threads$.withContextClassLoader(Threads.scala:21)
..............................
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)
2) Error injecting constructor, java.lang.NullPointerException
at play.db.ebean.EbeanDynamicEvolutions.<init>(EbeanDynamicEvolutions.java:35)
at play.db.ebean.EbeanDynamicEvolutions.class(EbeanDynamicEvolutions.java:32)
while locating play.db.ebean.EbeanDynamicEvolutions
at play.db.ebean.EbeanModule.bindings(EbeanModule.java:21):
Binding(class play.api.db.evolutions.DynamicEvolutions to ConstructionTarget(class play.db.ebean.EbeanDynamicEvolutions) eagerly) (via modules: com.google.inject.util.Modules$OverrideModule -> play.api.inject.guice.GuiceableModuleConversions$$anon)
while locating play.api.db.evolutions.DynamicEvolutions
Caused by: java.lang.NullPointerException
at io.ebeanservice.docstore.api.support.DocStoreBeanBaseAdapter.derive(DocStoreBeanBaseAdapter.java:323)
at io.ebeanservice.docstore.api.support.DocStoreBeanBaseAdapter.<init>(DocStoreBeanBaseAdapter.java:110)
at io.ebeanservice.docstore.none.NoneDocStoreBeanAdapter.<init>(NoneDocStoreBeanAdapter.java:17)
at io.ebeanservice.docstore.none.NoneDocStoreFactory.createAdapter(NoneDocStoreFactory.java:24)
..............................
at io.ebeaninternal.server.core.DefaultContainer.createServer(DefaultContainer.java:127)
at io.ebeaninternal.server.core.DefaultContainer.createServer(DefaultContainer.java:44)
at io.ebean.EbeanServerFactory.createInternal(EbeanServerFactory.java:108)
at io.ebean.EbeanServerFactory.create(EbeanServerFactory.java:67)
at play.db.ebean.EbeanDynamicEvolutions.lambda$start(EbeanDynamicEvolutions.java:49)
at java.util.HashMap.forEach(HashMap.java:1288)
at play.db.ebean.EbeanDynamicEvolutions.start(EbeanDynamicEvolutions.java:49)
at play.db.ebean.EbeanDynamicEvolutions.<init>(EbeanDynamicEvolutions.java:38)
at play.db.ebean.EbeanDynamicEvolutions$$FastClassByGuice$c94231.newInstance(<generated>)
at com.google.inject.internal.DefaultConstructionProxyFactory$FastClassProxy.newInstance(DefaultConstructionProxyFactory.java:89)
at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:111)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:90)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:268)
..............................
at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:180)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:110)
at com.google.inject.Guice.createInjector(Guice.java:99)
at com.google.inject.Guice.createInjector(Guice.java:84)
at play.api.inject.guice.GuiceBuilder.injector(GuiceInjectorBuilder.scala:181)
at play.api.inject.guice.GuiceApplicationBuilder.build(GuiceApplicationBuilder.scala:137)
at play.api.inject.guice.GuiceApplicationLoader.load(GuiceApplicationLoader.scala:21)
at play.core.server.DevServerStart$$anonfun$mainDev$$anon$$anonfun$get$$anonfun$apply$$anonfun$$anonfun.apply(DevServerStart.scala:166)
at play.core.server.DevServerStart$$anonfun$mainDev$$anon$$anonfun$get$$anonfun$apply$$anonfun$$anonfun.apply(DevServerStart.scala:163)
at play.utils.Threads$.withContextClassLoader(Threads.scala:21)
..............................
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)
2 errors
at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:470)
at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:184)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:110)
at com.google.inject.Guice.createInjector(Guice.java:99)
at com.google.inject.Guice.createInjector(Guice.java:84)
at play.api.inject.guice.GuiceBuilder.injector(GuiceInjectorBuilder.scala:181)
at play.api.inject.guice.GuiceApplicationBuilder.build(GuiceApplicationBuilder.scala:137)
at play.api.inject.guice.GuiceApplicationLoader.load(GuiceApplicationLoader.scala:21)
at play.core.server.DevServerStart$$anonfun$mainDev$$anon$$anonfun$get$$anonfun$apply$$anonfun$$anonfun.apply(DevServerStart.scala:166)
at play.core.server.DevServerStart$$anonfun$mainDev$$anon$$anonfun$get$$anonfun$apply$$anonfun$$anonfun.apply(DevServerStart.scala:163)
过去一周我一直在研究这个问题,如果能深入了解可能导致此问题的原因,我将不胜感激
您的配置应如下所示:
db {
sentinel {
driver=com.mysql.jdbc.Driver
url="**********"
username=****
password="*******"
hikaricp {
...
}
}
kodi {
driver=com.mysql.jdbc.Driver
url="******"
username=****
password="****"
hikaricp {
...
}
}
}
我继续清理我的常春藤缓存。我重新运行 sbt 构建并解决了正确的依赖关系。
我在尝试启动需要能够连接到两个数据库(一个具有实体的主数据库,另一个具有与说的实体)。我的项目结构如下。 在我的 build.sbt 中,我有以下行
playEbeanModels in Compile := Seq("models.sentinel.*", "models.kodi.*")
在我的 application.conf 中,我有以下指向包含实体
的包ebean.sentinel = ["models.sentinel.*"]
ebean.kodi = ["models.kodi.*"]
并这样配置数据源
db {
sentinel {
hikaricp {
dataSourceClassName = "com.mysql.jdbc.jdbc2.optional.MysqlDataSource"
maxLifetime=900000
idleTimeout=300000
maximumPoolSize=100
minimumIdle=5
username = sentinel
password = sentinelAdmin
dataSource {
user = *******
password = "*************"
databaseName = "sentinel"
serverName = "**********"
portNumber = 3306
interactiveClient=true
useUnicode=true
autoReconnect=true
prepStmtCacheSqlLimit=2048
cachePrepStmts=true
prepStmtCacheSize=250
useServerPrepStmts=true
}
}
}
kodi {
hikaricp {
dataSourceClassName = "com.mysql.jdbc.jdbc2.optional.MysqlDataSource"
maxLifetime=900000
idleTimeout=300000
maximumPoolSize=100
minimumIdle=5
username = kodi
password = kodiAdmin
dataSource {
user = ******
password = "********"
databaseName = "kodi"
serverName = "********"
portNumber = 3306
interactiveClient=true
useUnicode=true
autoReconnect=true
prepStmtCacheSqlLimit=2048
cachePrepStmts=true
prepStmtCacheSize=250
useServerPrepStmts=true
}
}
}
}
当我尝试编译并跟踪堆栈跟踪(截断以适合)时
[info] Babel compiling on 10 source(s)
[warn] application - Logger configuration in conf files is deprecated and has no effect. Use a logback configuration file instead.
[info] application - Creating Pool for datasource 'sentinel'
[info] p.a.d.DefaultDBApi - Database [sentinel] connected at jdbc:mysql://*********:3306/sentinel
[info] application - Creating Pool for datasource 'kodi'
[info] p.a.d.DefaultDBApi - Database [kodi] connected at jdbc:mysql://*********:3306/kodi
[error] i.e.s.d.BeanDescriptorManager - Error in deployment
java.lang.NullPointerException: null
at io.ebeanservice.docstore.api.support.DocStoreBeanBaseAdapter.derive(DocStoreBeanBaseAdapter.java:323)
at io.ebeanservice.docstore.api.support.DocStoreBeanBaseAdapter.<init>(DocStoreBeanBaseAdapter.java:110)
at io.ebeanservice.docstore.none.NoneDocStoreBeanAdapter.<init>(NoneDocStoreBeanAdapter.java:17)
at io.ebeanservice.docstore.none.NoneDocStoreFactory.createAdapter(NoneDocStoreFactory.java:24)
at io.ebeaninternal.server.deploy.BeanDescriptorManager.createDocStoreBeanAdapter(BeanDescriptorManager.java:260)
at io.ebeaninternal.server.deploy.BeanDescriptor.<init>(BeanDescriptor.java:491)
at io.ebeaninternal.server.deploy.BeanDescriptorManager.readEntityRelationships(BeanDescriptorManager.java:761)
at io.ebeaninternal.server.deploy.BeanDescriptorManager.deploy(BeanDescriptorManager.java:323)
at io.ebeaninternal.server.core.InternalConfiguration.<init>(InternalConfiguration.java:141)
at io.ebeaninternal.server.core.DefaultContainer.createServer(DefaultContainer.java:127)
[error] i.e.s.d.BeanDescriptorManager - Error in deployment
java.lang.NullPointerException: null
at io.ebeanservice.docstore.api.support.DocStoreBeanBaseAdapter.derive(DocStoreBeanBaseAdapter.java:323)
at io.ebeanservice.docstore.api.support.DocStoreBeanBaseAdapter.<init>(DocStoreBeanBaseAdapter.java:110)
at io.ebeanservice.docstore.none.NoneDocStoreBeanAdapter.<init>(NoneDocStoreBeanAdapter.java:17)
at io.ebeanservice.docstore.none.NoneDocStoreFactory.createAdapter(NoneDocStoreFactory.java:24)
at io.ebeaninternal.server.deploy.BeanDescriptorManager.createDocStoreBeanAdapter(BeanDescriptorManager.java:260)
at io.ebeaninternal.server.deploy.BeanDescriptor.<init>(BeanDescriptor.java:491)
at io.ebeaninternal.server.deploy.BeanDescriptorManager.readEntityRelationships(BeanDescriptorManager.java:761)
at io.ebeaninternal.server.deploy.BeanDescriptorManager.deploy(BeanDescriptorManager.java:323)
at io.ebeaninternal.server.core.InternalConfiguration.<init>(InternalConfiguration.java:141)
at io.ebeaninternal.server.core.DefaultContainer.createServer(DefaultContainer.java:127)
[info] application - ApplicationTimer demo: Starting application at 2017-03-29T13:44:16.602Z
[error] application -
! @73fn6o32j - Internal server error, for (GET) [/] ->
play.api.UnexpectedException: Unexpected exception[CreationException: Unable to create injector, see the following errors:
1) Error injecting constructor, java.lang.NullPointerException
at play.db.ebean.EbeanDynamicEvolutions.<init>(EbeanDynamicEvolutions.java:35)
at play.db.ebean.EbeanDynamicEvolutions.class(EbeanDynamicEvolutions.java:32)
while locating play.db.ebean.EbeanDynamicEvolutions
at play.db.ebean.EbeanModule.bindings(EbeanModule.java:21):
Binding(class play.api.db.evolutions.DynamicEvolutions to ConstructionTarget(class play.db.ebean.EbeanDynamicEvolutions) eagerly) (via modules: com.google.inject.util.Modules$OverrideModule -> play.api.inject.guice.GuiceableModuleConversions$$anon)
while locating play.api.db.evolutions.DynamicEvolutions
while locating play.api.db.evolutions.ApplicationEvolutionsProvider
at play.api.db.evolutions.EvolutionsModule.<init>(EvolutionsModule.scala:20):
Binding(class play.api.db.evolutions.ApplicationEvolutions to ProviderConstructionTarget(class play.api.db.evolutions.ApplicationEvolutionsProvider) eagerly) (via modules: com.google.inject.util.Modules$OverrideModule -> play.api.inject.guice.GuiceableModuleConversions$$anon)
while locating play.api.db.evolutions.ApplicationEvolutions
Caused by: java.lang.NullPointerException
at io.ebeanservice.docstore.api.support.DocStoreBeanBaseAdapter.derive(DocStoreBeanBaseAdapter.java:323)
at io.ebeanservice.docstore.api.support.DocStoreBeanBaseAdapter.<init>(DocStoreBeanBaseAdapter.java:110)
..............................
at io.ebean.EbeanServerFactory.createInternal(EbeanServerFactory.java:108)
at io.ebean.EbeanServerFactory.create(EbeanServerFactory.java:67)
at play.db.ebean.EbeanDynamicEvolutions.lambda$start(EbeanDynamicEvolutions.java:49)
at java.util.HashMap.forEach(HashMap.java:1288)
at play.db.ebean.EbeanDynamicEvolutions.start(EbeanDynamicEvolutions.java:49)
at play.db.ebean.EbeanDynamicEvolutions.<init>(EbeanDynamicEvolutions.java:38)
at play.db.ebean.EbeanDynamicEvolutions$$FastClassByGuice$c94231.newInstance(<generated>)
at com.google.inject.internal.DefaultConstructionProxyFactory$FastClassProxy.newInstance(DefaultConstructionProxyFactory.java:89)
..............................
at com.google.inject.internal.InjectorImpl.get(InjectorImpl.java:1015)
at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1054)
at play.api.inject.guice.GuiceInjector.instanceOf(GuiceInjectorBuilder.scala:405)
at play.api.inject.guice.GuiceInjector.instanceOf(GuiceInjectorBuilder.scala:400)
at play.api.db.evolutions.ApplicationEvolutionsProvider.get$lzycompute(EvolutionsModule.scala:49)
at play.api.db.evolutions.ApplicationEvolutionsProvider.get(EvolutionsModule.scala:49)
at play.api.db.evolutions.ApplicationEvolutionsProvider.get(EvolutionsModule.scala:40)
at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:81)
at com.google.inject.internal.BoundProviderFactory.provision(BoundProviderFactory.java:72)
at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:61)
at com.google.inject.internal.BoundProviderFactory.get(BoundProviderFactory.java:62)
..............................
at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:180)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:110)
at com.google.inject.Guice.createInjector(Guice.java:99)
at com.google.inject.Guice.createInjector(Guice.java:84)
at play.api.inject.guice.GuiceBuilder.injector(GuiceInjectorBuilder.scala:181)
at play.api.inject.guice.GuiceApplicationBuilder.build(GuiceApplicationBuilder.scala:137)
..............................
at play.core.server.DevServerStart$$anonfun$mainDev$$anon$$anonfun$get.apply(DevServerStart.scala:126)
at play.core.server.DevServerStart$$anonfun$mainDev$$anon$$anonfun$get.apply(DevServerStart.scala:118)
at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1(Future.scala:24)
at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24)
at scala.concurrent.impl.ExecutionContextImpl$AdaptedForkJoinTask.exec(ExecutionContextImpl.scala:121)
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)
2) Error injecting constructor, java.lang.NullPointerException
at play.db.ebean.EbeanDynamicEvolutions.<init>(EbeanDynamicEvolutions.java:35)
at play.db.ebean.EbeanDynamicEvolutions.class(EbeanDynamicEvolutions.java:32)
while locating play.db.ebean.EbeanDynamicEvolutions
at play.db.ebean.EbeanModule.bindings(EbeanModule.java:21):
Binding(class play.api.db.evolutions.DynamicEvolutions to ConstructionTarget(class play.db.ebean.EbeanDynamicEvolutions) eagerly) (via modules: com.google.inject.util.Modules$OverrideModule -> play.api.inject.guice.GuiceableModuleConversions$$anon)
while locating play.api.db.evolutions.DynamicEvolutions
Caused by: java.lang.NullPointerException
at io.ebeanservice.docstore.api.support.DocStoreBeanBaseAdapter.derive(DocStoreBeanBaseAdapter.java:323)
at io.ebeanservice.docstore.api.support.DocStoreBeanBaseAdapter.<init>(DocStoreBeanBaseAdapter.java:110)
..............................
at io.ebeaninternal.server.core.DefaultContainer.createServer(DefaultContainer.java:127)
at io.ebeaninternal.server.core.DefaultContainer.createServer(DefaultContainer.java:44)
at io.ebean.EbeanServerFactory.createInternal(EbeanServerFactory.java:108)
at io.ebean.EbeanServerFactory.create(EbeanServerFactory.java:67)
at play.db.ebean.EbeanDynamicEvolutions.lambda$start(EbeanDynamicEvolutions.java:49)
at java.util.HashMap.forEach(HashMap.java:1288)
at play.db.ebean.EbeanDynamicEvolutions.start(EbeanDynamicEvolutions.java:49)
at play.db.ebean.EbeanDynamicEvolutions.<init>(EbeanDynamicEvolutions.java:38)
at play.db.ebean.EbeanDynamicEvolutions$$FastClassByGuice$c94231.newInstance(<generated>)
at com.google.inject.internal.DefaultConstructionProxyFactory$FastClassProxy.newInstance(DefaultConstructionProxyFactory.java:89)
at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:111)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:90)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:268)
..............................
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:110)
at com.google.inject.Guice.createInjector(Guice.java:99)
at com.google.inject.Guice.createInjector(Guice.java:84)
at play.api.inject.guice.GuiceBuilder.injector(GuiceInjectorBuilder.scala:181)
at play.api.inject.guice.GuiceApplicationBuilder.build(GuiceApplicationBuilder.scala:137)
..............................
at scala.concurrent.impl.ExecutionContextImpl$AdaptedForkJoinTask.exec(ExecutionContextImpl.scala:121)
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)
2 errors]
at play.core.server.DevServerStart$$anonfun$mainDev$$anon$$anonfun$get$$anonfun$apply$$anonfun.apply(DevServerStart.scala:178)
at play.core.server.DevServerStart$$anonfun$mainDev$$anon$$anonfun$get$$anonfun$apply$$anonfun.apply(DevServerStart.scala:128)
at scala.Option.map(Option.scala:146)
at play.core.server.DevServerStart$$anonfun$mainDev$$anon$$anonfun$get$$anonfun$apply.apply(DevServerStart.scala:128)
at play.core.server.DevServerStart$$anonfun$mainDev$$anon$$anonfun$get$$anonfun$apply.apply(DevServerStart.scala:126)
at scala.util.Success.flatMap(Try.scala:231)
at play.core.server.DevServerStart$$anonfun$mainDev$$anon$$anonfun$get.apply(DevServerStart.scala:126)
at play.core.server.DevServerStart$$anonfun$mainDev$$anon$$anonfun$get.apply(DevServerStart.scala:118)
at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1(Future.scala:24)
at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24)
Caused by: com.google.inject.CreationException: Unable to create injector, see the following errors:
1) Error injecting constructor, java.lang.NullPointerException
at play.db.ebean.EbeanDynamicEvolutions.<init>(EbeanDynamicEvolutions.java:35)
at play.db.ebean.EbeanDynamicEvolutions.class(EbeanDynamicEvolutions.java:32)
while locating play.db.ebean.EbeanDynamicEvolutions
at play.db.ebean.EbeanModule.bindings(EbeanModule.java:21):
Binding(class play.api.db.evolutions.DynamicEvolutions to ConstructionTarget(class play.db.ebean.EbeanDynamicEvolutions) eagerly) (via modules: com.google.inject.util.Modules$OverrideModule -> play.api.inject.guice.GuiceableModuleConversions$$anon)
while locating play.api.db.evolutions.DynamicEvolutions
while locating play.api.db.evolutions.ApplicationEvolutionsProvider
at play.api.db.evolutions.EvolutionsModule.<init>(EvolutionsModule.scala:20):
Binding(class play.api.db.evolutions.ApplicationEvolutions to ProviderConstructionTarget(class play.api.db.evolutions.ApplicationEvolutionsProvider) eagerly) (via modules: com.google.inject.util.Modules$OverrideModule -> play.api.inject.guice.GuiceableModuleConversions$$anon)
while locating play.api.db.evolutions.ApplicationEvolutions
Caused by: java.lang.NullPointerException
at io.ebeanservice.docstore.api.support.DocStoreBeanBaseAdapter.derive(DocStoreBeanBaseAdapter.java:323)
at io.ebeanservice.docstore.api.support.DocStoreBeanBaseAdapter.<init>(DocStoreBeanBaseAdapter.java:110)
at io.ebeanservice.docstore.none.NoneDocStoreBeanAdapter.<init>(NoneDocStoreBeanAdapter.java:17)
..............................
at io.ebeaninternal.server.core.InternalConfiguration.<init>(InternalConfiguration.java:141)
at io.ebeaninternal.server.core.DefaultContainer.createServer(DefaultContainer.java:127)
at io.ebeaninternal.server.core.DefaultContainer.createServer(DefaultContainer.java:44)
at io.ebean.EbeanServerFactory.createInternal(EbeanServerFactory.java:108)
at io.ebean.EbeanServerFactory.create(EbeanServerFactory.java:67)
at play.db.ebean.EbeanDynamicEvolutions.lambda$start(EbeanDynamicEvolutions.java:49)
at java.util.HashMap.forEach(HashMap.java:1288)
at play.db.ebean.EbeanDynamicEvolutions.start(EbeanDynamicEvolutions.java:49)
at play.db.ebean.EbeanDynamicEvolutions.<init>(EbeanDynamicEvolutions.java:38)
at play.db.ebean.EbeanDynamicEvolutions$$FastClassByGuice$c94231.newInstance(<generated>)
at com.google.inject.internal.DefaultConstructionProxyFactory$FastClassProxy.newInstance(DefaultConstructionProxyFactory.java:89)
at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:111)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:90)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:268)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.call(ProviderToInternalFactoryAdapter.java:46)
..............................
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
at com.google.inject.internal.InjectorImpl.get(InjectorImpl.java:1015)
at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1054)
at play.api.inject.guice.GuiceInjector.instanceOf(GuiceInjectorBuilder.scala:405)
at play.api.inject.guice.GuiceInjector.instanceOf(GuiceInjectorBuilder.scala:400)
at play.api.db.evolutions.ApplicationEvolutionsProvider.get$lzycompute(EvolutionsModule.scala:49)
at play.api.db.evolutions.ApplicationEvolutionsProvider.get(EvolutionsModule.scala:49)
at play.api.db.evolutions.ApplicationEvolutionsProvider.get(EvolutionsModule.scala:40)
at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:81)
at com.google.inject.internal.BoundProviderFactory.provision(BoundProviderFactory.java:72)
..............................
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1085)
at com.google.inject.internal.InternalInjectorCreator.loadEagerSingletons(InternalInjectorCreator.java:199)
at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:180)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:110)
at com.google.inject.Guice.createInjector(Guice.java:99)
at com.google.inject.Guice.createInjector(Guice.java:84)
at play.api.inject.guice.GuiceBuilder.injector(GuiceInjectorBuilder.scala:181)
at play.api.inject.guice.GuiceApplicationBuilder.build(GuiceApplicationBuilder.scala:137)
at play.api.inject.guice.GuiceApplicationLoader.load(GuiceApplicationLoader.scala:21)
at play.core.server.DevServerStart$$anonfun$mainDev$$anon$$anonfun$get$$anonfun$apply$$anonfun$$anonfun.apply(DevServerStart.scala:166)
at play.core.server.DevServerStart$$anonfun$mainDev$$anon$$anonfun$get$$anonfun$apply$$anonfun$$anonfun.apply(DevServerStart.scala:163)
at play.utils.Threads$.withContextClassLoader(Threads.scala:21)
..............................
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)
2) Error injecting constructor, java.lang.NullPointerException
at play.db.ebean.EbeanDynamicEvolutions.<init>(EbeanDynamicEvolutions.java:35)
at play.db.ebean.EbeanDynamicEvolutions.class(EbeanDynamicEvolutions.java:32)
while locating play.db.ebean.EbeanDynamicEvolutions
at play.db.ebean.EbeanModule.bindings(EbeanModule.java:21):
Binding(class play.api.db.evolutions.DynamicEvolutions to ConstructionTarget(class play.db.ebean.EbeanDynamicEvolutions) eagerly) (via modules: com.google.inject.util.Modules$OverrideModule -> play.api.inject.guice.GuiceableModuleConversions$$anon)
while locating play.api.db.evolutions.DynamicEvolutions
Caused by: java.lang.NullPointerException
at io.ebeanservice.docstore.api.support.DocStoreBeanBaseAdapter.derive(DocStoreBeanBaseAdapter.java:323)
at io.ebeanservice.docstore.api.support.DocStoreBeanBaseAdapter.<init>(DocStoreBeanBaseAdapter.java:110)
at io.ebeanservice.docstore.none.NoneDocStoreBeanAdapter.<init>(NoneDocStoreBeanAdapter.java:17)
at io.ebeanservice.docstore.none.NoneDocStoreFactory.createAdapter(NoneDocStoreFactory.java:24)
..............................
at io.ebeaninternal.server.core.DefaultContainer.createServer(DefaultContainer.java:127)
at io.ebeaninternal.server.core.DefaultContainer.createServer(DefaultContainer.java:44)
at io.ebean.EbeanServerFactory.createInternal(EbeanServerFactory.java:108)
at io.ebean.EbeanServerFactory.create(EbeanServerFactory.java:67)
at play.db.ebean.EbeanDynamicEvolutions.lambda$start(EbeanDynamicEvolutions.java:49)
at java.util.HashMap.forEach(HashMap.java:1288)
at play.db.ebean.EbeanDynamicEvolutions.start(EbeanDynamicEvolutions.java:49)
at play.db.ebean.EbeanDynamicEvolutions.<init>(EbeanDynamicEvolutions.java:38)
at play.db.ebean.EbeanDynamicEvolutions$$FastClassByGuice$c94231.newInstance(<generated>)
at com.google.inject.internal.DefaultConstructionProxyFactory$FastClassProxy.newInstance(DefaultConstructionProxyFactory.java:89)
at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:111)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:90)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:268)
..............................
at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:180)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:110)
at com.google.inject.Guice.createInjector(Guice.java:99)
at com.google.inject.Guice.createInjector(Guice.java:84)
at play.api.inject.guice.GuiceBuilder.injector(GuiceInjectorBuilder.scala:181)
at play.api.inject.guice.GuiceApplicationBuilder.build(GuiceApplicationBuilder.scala:137)
at play.api.inject.guice.GuiceApplicationLoader.load(GuiceApplicationLoader.scala:21)
at play.core.server.DevServerStart$$anonfun$mainDev$$anon$$anonfun$get$$anonfun$apply$$anonfun$$anonfun.apply(DevServerStart.scala:166)
at play.core.server.DevServerStart$$anonfun$mainDev$$anon$$anonfun$get$$anonfun$apply$$anonfun$$anonfun.apply(DevServerStart.scala:163)
at play.utils.Threads$.withContextClassLoader(Threads.scala:21)
..............................
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)
2 errors
at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:470)
at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:184)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:110)
at com.google.inject.Guice.createInjector(Guice.java:99)
at com.google.inject.Guice.createInjector(Guice.java:84)
at play.api.inject.guice.GuiceBuilder.injector(GuiceInjectorBuilder.scala:181)
at play.api.inject.guice.GuiceApplicationBuilder.build(GuiceApplicationBuilder.scala:137)
at play.api.inject.guice.GuiceApplicationLoader.load(GuiceApplicationLoader.scala:21)
at play.core.server.DevServerStart$$anonfun$mainDev$$anon$$anonfun$get$$anonfun$apply$$anonfun$$anonfun.apply(DevServerStart.scala:166)
at play.core.server.DevServerStart$$anonfun$mainDev$$anon$$anonfun$get$$anonfun$apply$$anonfun$$anonfun.apply(DevServerStart.scala:163)
过去一周我一直在研究这个问题,如果能深入了解可能导致此问题的原因,我将不胜感激
您的配置应如下所示:
db {
sentinel {
driver=com.mysql.jdbc.Driver
url="**********"
username=****
password="*******"
hikaricp {
...
}
}
kodi {
driver=com.mysql.jdbc.Driver
url="******"
username=****
password="****"
hikaricp {
...
}
}
}
我继续清理我的常春藤缓存。我重新运行 sbt 构建并解决了正确的依赖关系。