问:
Play, Ebeans: NullPointerException when starting application with multiple DBs
I'm having an issue when trying to launch an application (using Play v2.5.10) that needs to be able to connect to two DB's (one master DB with entities and the other with time series data relating to the said entities). My project is structured as follows.
In my build.sbt I have the following line

```<code>playEbeanModels in Compile := Seq("models.sentinel.*", "models.kodi.*")
</code>```

in my application.conf I have the following pointing to the package containing the Entity

```<code>ebean.sentinel = ["models.sentinel.*"]
ebean.kodi = ["models.kodi.*"]
</code>```

and configured the datasources as such

```<code>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
      }
    }
  }
}
</code>```

When I try and compile and following stack trace (truncated to fit)

```[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$1)
  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$1)
  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$3(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$$52c94231.newInstance(<generated>)
    at com.google.inject.internal.DefaultConstructionProxyFactory$FastClassProxy.newInstance(DefaultConstructionProxyFactory.java:89)
    ..............................
    at com.google.inject.internal.InjectorImpl$2.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$1$$anon$1$$anonfun$get$1.apply(DevServerStart.scala:126)
    at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1.apply(DevServerStart.scala:118)
    at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(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$1)
  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$3(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$$52c94231.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$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(DevServerStart.scala:178)
    at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(DevServerStart.scala:128)
    at scala.Option.map(Option.scala:146)
    at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1.apply(DevServerStart.scala:128)
    at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1.apply(DevServerStart.scala:126)
    at scala.util.Success.flatMap(Try.scala:231)
    at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1.apply(DevServerStart.scala:126)
    at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1.apply(DevServerStart.scala:118)
    at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(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$1)
  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$1)
  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$3(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$$52c94231.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$1.call(ProviderToInternalFactoryAdapter.java:46)
    ..............................
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
    at com.google.inject.internal.InjectorImpl$2.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$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1$$anonfun$2.apply(DevServerStart.scala:166)
    at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1$$anonfun$2.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$1)
  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$3(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$$52c94231.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$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1$$anonfun$2.apply(DevServerStart.scala:166)
    at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1$$anonfun$2.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$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1$$anonfun$2.apply(DevServerStart.scala:166)
    at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1$$anonfun$2.apply(DevServerStart.scala:163)
```

I've been spinning my wheels on this for the past week and would really appreciate any insight into what might be causing this

答:
This is how your configuration should look like:</p>

```<code>db {
  sentinel {
    driver=com.mysql.jdbc.Driver
    url="**********"
    username=****
    password="*******"
    hikaricp {
        ...
    }
  }

  kodi {
    driver=com.mysql.jdbc.Driver
    url="******"
    username=****
    password="****"
    hikaricp {
        ...
    }
  }
}
</code>```

Body:
I'm having an issue when trying to launch an application (using Play v2.5.10) that needs to be able to connect to two DB's (one master DB with entities and the other with time series data relating to the said entities). My project is structured as follows.
In my build.sbt I have the following line

playEbeanModels in Compile := Seq("models.sentinel.*", "models.kodi.*")

in my application.conf I have the following pointing to the package containing the Entity

ebean.sentinel = ["models.sentinel.*"]
ebean.kodi = ["models.kodi.*"]

and configured the datasources as such

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
      }
    }
  }
}

When I try and compile and following stack trace (truncated to fit)

[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$1)
  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$1)
  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$3(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$$52c94231.newInstance(<generated>)
    at com.google.inject.internal.DefaultConstructionProxyFactory$FastClassProxy.newInstance(DefaultConstructionProxyFactory.java:89)
    ..............................
    at com.google.inject.internal.InjectorImpl$2.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$1$$anon$1$$anonfun$get$1.apply(DevServerStart.scala:126)
    at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1.apply(DevServerStart.scala:118)
    at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(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$1)
  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$3(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$$52c94231.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$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(DevServerStart.scala:178)
    at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(DevServerStart.scala:128)
    at scala.Option.map(Option.scala:146)
    at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1.apply(DevServerStart.scala:128)
    at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1.apply(DevServerStart.scala:126)
    at scala.util.Success.flatMap(Try.scala:231)
    at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1.apply(DevServerStart.scala:126)
    at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1.apply(DevServerStart.scala:118)
    at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(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$1)
  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$1)
  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$3(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$$52c94231.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$1.call(ProviderToInternalFactoryAdapter.java:46)
    ..............................
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
    at com.google.inject.internal.InjectorImpl$2.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$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1$$anonfun$2.apply(DevServerStart.scala:166)
    at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1$$anonfun$2.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$1)
  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$3(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$$52c94231.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$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1$$anonfun$2.apply(DevServerStart.scala:166)
    at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1$$anonfun$2.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$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1$$anonfun$2.apply(DevServerStart.scala:166)
    at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1$$anonfun$2.apply(DevServerStart.scala:163)

I've been spinning my wheels on this for the past week and would really appreciate any insight into what might be causing this

Body:
This is how your configuration should look like:

db {
  sentinel {
    driver=com.mysql.jdbc.Driver
    url="**********"
    username=****
    password="*******"
    hikaricp {
        ...
    }
  }

  kodi {
    driver=com.mysql.jdbc.Driver
    url="******"
    username=****
    password="****"
    hikaricp {
        ...
    }
  }
}


来源: stackexchange

问:
Cross domain api call with post request in angular 2
```<code>return this.http.post(this._InstUrl, body, options)
                               .map((res: Response) => {res.json() })
                               .subscribe(
                                        (data) => {
                                            console.log(this.Result);
                                        },
                                        (error) => {
                                             console.log(error);
                                        });
</code>```

When i execute above code, it didn't get work for me and showing below mentioned error.

Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:55139' is therefore not allowed access. The response had HTTP status code 405.

Can anyone help me on this issue?

答:
Here example of post request for cross domain in angular 2</p>

```<code> this._InstUrl = 'https://api.instagram.com/v1/media/' + listOfMedia[0].id + '/likes?access_token=' + this.hdnaccess_token;
            let headers = new Headers({ 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' });
            var requestoptions = new RequestOptions({
                method: RequestMethod.Post,
                url: this._InstUrl,
                headers: headers,
            })

            return this.http.request(new Request(requestoptions))
                .map((res) => {
                    debugger;
                    if (res) {
                        //return { status: res.status, json: res.json() }
                    }
                })
                .subscribe(
                (data) => {
                    //if (this.Result.length == 0) { this.NoData = true; }
                    debugger; console.log(this.Result);
                },
                (error) => {
                    debugger; console.log(error);
                });
</code>```

ContentLicense: CC BY-SA 3.0

Body:
return this.http.post(this._InstUrl, body, options)
                               .map((res: Response) => {res.json() })
                               .subscribe(
                                        (data) => {
                                            console.log(this.Result);
                                        },
                                        (error) => {
                                             console.log(error);
                                        });

When i execute above code, it didn't get work for me and showing below mentioned error.

Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:55139' is therefore not allowed access. The response had HTTP status code 405.

Can anyone help me on this issue?

Body:
Here example of post request for cross domain in angular 2

 this._InstUrl = 'https://api.instagram.com/v1/media/' + listOfMedia[0].id + '/likes?access_token=' + this.hdnaccess_token;
            let headers = new Headers({ 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' });
            var requestoptions = new RequestOptions({
                method: RequestMethod.Post,
                url: this._InstUrl,
                headers: headers,
            })

            return this.http.request(new Request(requestoptions))
                .map((res) => {
                    debugger;
                    if (res) {
                        //return { status: res.status, json: res.json() }
                    }
                })
                .subscribe(
                (data) => {
                    //if (this.Result.length == 0) { this.NoData = true; }
                    debugger; console.log(this.Result);
                },
                (error) => {
                    debugger; console.log(error);
                });


问:
Why do we need two interfaces to enumerate a collection?
It is quite a while that I have been trying to understand the idea behind IEnumerable and IEnumerator. I read all the questions and answers I could find over the net, and on StackOverflow in particular, but I am not satisfied. I got to the point where I understand how those interfaces should be used, but not why they are used this way.

I think that the essence of my misunderstanding is that we need two interfaces for one operation. I realized that if both are needed, one was probably not enough. So I took the "hard coded" equivalent of foreach (as I found here):

```<code>while (enumerator.MoveNext())
{
    object item = enumerator.Current;

    // logic
}
</code>```

and tried to get it to work with one interface, thinking something would go wrong which would make me understand why another interface is needed.

So I created a collection class, and implemented IForeachable:

```<code>class Collection : IForeachable
{
    private int[] array = { 1, 2, 3, 4, 5 };
    private int index = -1;

    public int Current => array[index];

    public bool MoveNext()
    {
        if (index < array.Length - 1)
        {
            index++;
            return true;
        }

        index = -1;
        return false;
    }
}
</code>```

and used the foreach equivalent to nominate the collection:

```<code>var collection = new Collection();

while (collection.MoveNext())
{
    object item = collection.Current;

    Console.WriteLine(item);
}
</code>```

And it works! So what is missing here that make another interface required?

Thanks.

Edit:
My question is not a duplicate of the questions listed in the comments:

This question is why interfaces are needed for enumerating in the first place.

This question and this question are about what are those interfaces and how should they be used.

My question is why they are designed the way they are, not what are they, how they work, and why do we need them in the first place.

答:
Your IForeachable cannot even be iterated from two different threads (you cannot have multiple active iterations at all - even from the same thread), because current enumeration state stored in IForeachable itself. You also have to reset your current position each time you finished enumeration, and if you forgot to do that - well, next caller will think your collection is empty. I can only imagine all kind of hard to track bugs this all might lead to.

On the other hand, because IEnumerable returns new IEnumerator for each caller - you can have multiple enumerations in progress simultaneously, because each caller has it's own enumeration state. I think this reason alone is enough to justify two interfaces. Enumeration is essentially read operation, and it would have been very confusing if you cannot read the same thing simultaneously in multiple places.

Body:
It is quite a while that I have been trying to understand the idea behind IEnumerable and IEnumerator. I read all the questions and answers I could find over the net, and on StackOverflow in particular, but I am not satisfied. I got to the point where I understand how those interfaces should be used, but not why they are used this way.

I think that the essence of my misunderstanding is that we need two interfaces for one operation. I realized that if both are needed, one was probably not enough. So I took the "hard coded" equivalent of foreach (as I found here):

while (enumerator.MoveNext())
{
    object item = enumerator.Current;

    // logic
}

and tried to get it to work with one interface, thinking something would go wrong which would make me understand why another interface is needed.

So I created a collection class, and implemented IForeachable:

class Collection : IForeachable
{
    private int[] array = { 1, 2, 3, 4, 5 };
    private int index = -1;

    public int Current => array[index];

    public bool MoveNext()
    {
        if (index < array.Length - 1)
        {
            index++;
            return true;
        }

        index = -1;
        return false;
    }
}

and used the foreach equivalent to nominate the collection:

var collection = new Collection();

while (collection.MoveNext())
{
    object item = collection.Current;

    Console.WriteLine(item);
}

And it works! So what is missing here that make another interface required?

Thanks.

Edit:
My question is not a duplicate of the questions listed in the comments:

This question is why interfaces are needed for enumerating in the first place.

This question and this question are about what are those interfaces and how should they be used.

My question is why they are designed the way they are, not what are they, how they work, and why do we need them in the first place.


问:
Count number of values in array with a given value
Say I have an array like this:

```<code>$array = array('', '', 'other', '', 'other');
</code>```

How can I count the number with a given value (in the example blank)?

And do it efficiently? (for about a dozen arrays with hundreds of elements each)
This example times out (over 30 sec):

```<code>function without($array) {
    $counter = 0;
    for($i = 0, $e = count($array); $i < $e; $i++) {
        if(empty($array[$i])) {
            $counter += 1;
        }
    }
    return $counter;
}
</code>```

In this case the number of blank elements is 3.

答:
Generally for counting blanks only.
Really depends on use case and speed needed. Personally I like doing things one one line.

Like the chosen response though But you still need a line to extract the data needed though to another variable.

```<code>$r = count($x) - count(array_filter($x));
</code>```

Body:
Say I have an array like this:

$array = array('', '', 'other', '', 'other');

How can I count the number with a given value (in the example blank)?

And do it efficiently? (for about a dozen arrays with hundreds of elements each)
This example times out (over 30 sec):

function without($array) {
    $counter = 0;
    for($i = 0, $e = count($array); $i < $e; $i++) {
        if(empty($array[$i])) {
            $counter += 1;
        }
    }
    return $counter;
}

In this case the number of blank elements is 3.

Body:
Generally for counting blanks only.
Really depends on use case and speed needed. Personally I like doing things one one line.

Like the chosen response though But you still need a line to extract the data needed though to another variable.

$r = count($x) - count(array_filter($x));


问:
Could not bind proxy receiver to the RMI registry
I am trying to connect to matlab from java file and do some operations. Some times it is working fine but sometimes while trying to connect to matlab from java I am getting an error.

The code which I use for connecting to matlab is

```<code>MatlabProxyFactoryOptions options = new MatlabProxyFactoryOptions.Builder()
        .setMatlabLocation("/usr/local/MATLAB/R2014a/bin/matlab")
            .build();

MatlabProxyFactory factory = new MatlabProxyFactory(options); //Create a proxy, which we will use to control MATLAB
MatlabProxy proxy = factory.getProxy();

proxy.eval("addpath SourceCode/Hipc/");
String executeThis = "run_BVD(" + upload2Bean.getUserImage2FileName() + ",1);";
proxy.eval(executeThis);
proxy.exit();

proxy.disconnect(); //Disconnect the proxy from MATLAB
</code>```

Error is

matlabcontrol.MatlabConnectionException: Could not bind proxy receiver to the RMI registry
    at matlabcontrol.RemoteMatlabProxyFactory.requestProxy(RemoteMatlabProxyFactory.java:104)
    at matlabcontrol.RemoteMatlabProxyFactory.getProxy(RemoteMatlabProxyFactory.java:144)
    at matlabcontrol.MatlabProxyFactory.getProxy(MatlabProxyFactory.java:81)
    at com.Daos.Upload2Dao.upload(Upload2Dao.java:43)
    at com.ActionClasses.Upload2Action.execute(Upload2Action.java:94)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:440)
    at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:279)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242)
    at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:163)
    at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
    at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:249)
    at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
    at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
    at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
    at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)
    at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
    at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)
    at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
    at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:148)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
    at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:93)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
    at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:306)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
    at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
    at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:128)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
    at org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:104)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
    at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
    at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
    at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138)
    at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
    at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:148)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
    at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
    at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:128)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
    at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
    at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:306)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
    at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
    at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:468)
    at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:395)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.rmi.NoSuchObjectException: no such object in table
    at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:276)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:253)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:379)
    at sun.rmi.registry.RegistryImpl_Stub.bind(Unknown Source)
    at matlabcontrol.RemoteMatlabProxyFactory.requestProxy(RemoteMatlabProxyFactory.java:99)
    ... 75 more

答: I also got this error on Windows 10, and when I checked the Task Manager, Background Processes (Ctrl+Shift+Esc). Apparently there was 10 background Matlab processes running under the hood, and I did not use any parfor loop at the time, so after killing all those processes, everything worked fine again. </p>

Body:
I am trying to connect to matlab from java file and do some operations. Some times it is working fine but sometimes while trying to connect to matlab from java I am getting an error.

The code which I use for connecting to matlab is

MatlabProxyFactoryOptions options = new MatlabProxyFactoryOptions.Builder()
        .setMatlabLocation("/usr/local/MATLAB/R2014a/bin/matlab")
            .build();

MatlabProxyFactory factory = new MatlabProxyFactory(options); //Create a proxy, which we will use to control MATLAB
MatlabProxy proxy = factory.getProxy();

proxy.eval("addpath SourceCode/Hipc/");
String executeThis = "run_BVD(" + upload2Bean.getUserImage2FileName() + ",1);";
proxy.eval(executeThis);
proxy.exit();

proxy.disconnect(); //Disconnect the proxy from MATLAB

Error is

matlabcontrol.MatlabConnectionException: Could not bind proxy receiver to the RMI registry
    at matlabcontrol.RemoteMatlabProxyFactory.requestProxy(RemoteMatlabProxyFactory.java:104)
    at matlabcontrol.RemoteMatlabProxyFactory.getProxy(RemoteMatlabProxyFactory.java:144)
    at matlabcontrol.MatlabProxyFactory.getProxy(MatlabProxyFactory.java:81)
    at com.Daos.Upload2Dao.upload(Upload2Dao.java:43)
    at com.ActionClasses.Upload2Action.execute(Upload2Action.java:94)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:440)
    at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:279)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242)
    at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:163)
    at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
    at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:249)
    at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
    at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
    at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
    at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)
    at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
    at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)
    at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
    at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:148)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
    at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:93)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
    at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:306)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
    at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
    at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:128)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
    at org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:104)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
    at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
    at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
    at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138)
    at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
    at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:148)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
    at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
    at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:128)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
    at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
    at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:306)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
    at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
    at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:468)
    at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:395)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.rmi.NoSuchObjectException: no such object in table
    at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:276)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:253)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:379)
    at sun.rmi.registry.RegistryImpl_Stub.bind(Unknown Source)
    at matlabcontrol.RemoteMatlabProxyFactory.requestProxy(RemoteMatlabProxyFactory.java:99)
    ... 75 more


问:
Dynamics CRM2016: cannot read property 'SetParameter' of undefined
I've subgrid on Account form, I am trying to get list of Orders of child contact and then add to subgrid. So, far I did the following scripts but it throws error that cannot read property 'SetParameter' of undefined. Can anyone please guide how can I change fetchxml of a subgrid?

```<code>function listOfOrders(contactId){
    var orderFetchXml = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>"+
                    "  <entity name='salesorder'>"+
                    "    <attribute name='name' />"+
                    "    <attribute name='customerid' />"+
                    "    <attribute name='salesorderid' />"+
                    "    <attribute name='statecode' />"+
                    "    <attribute name='createdon' />"+
                    "    <order attribute='name' descending='false' />"+
                    "    <filter type='and'>"+
                    "      <condition attribute='customerid' operator='eq' uitype='contact' value='"+contactId+"' />"+
                    "    </filter>"+
                    "  </entity>"+
                    "</fetch>";

    var retrievedOrders = XrmServiceToolkit.Soap.Fetch(orderFetchXml);

        var contactId = "";
        if(retrievedOrders.length <0)
            return;

    var viewId = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX";
    var viewDisName = "Account Orders subgridview";

     var layOutXml = "<grid name='resultset' object='1' jump='name' select='1' icon='1' preview='1'>" +
                            "<row name='result' id='salesorderid'>" +
                            "<cell name='name' width='300' />" +
                            "<cell name='statecode' />"+
                            "<cell name='createdon' />"+
                            "<cell name='customerid' />"+
                            "disableSorting='1' />" +
                            "</row>" +
                    "</grid>";
    var orderSubgrid = window.parent.document.getElementById("orderssubgrid");
    //apply layout and filtered fetchXML
    orderSubgrid.control.SetParameter("layoutXml", layOutXml);
    orderSubgrid.control.SetParameter("fetchXml", orderFetchXml);
    //Refresh grid to show filtered records only.
    orderSubgrid.control.Refresh();
}
</code>```

答:
Yes you could use a timeout. The code would look like:

```<code>function listOfOrders(contactId) {
    var orderSubgrid = window.parent.document.getElementById("orderssubgrid");
    if (orderSubgrid == null) {
        setTimeout(function () { listofOrders(contactId); }, 2000);
        return;
    }
    // ... the rest of your code
}
</code>```

If you wanted to try a supported method there were new subgrid methods added to Xrm in 2016. You might want to see if it's possible to use setCurrentView.

Body:
I've subgrid on Account form, I am trying to get list of Orders of child contact and then add to subgrid. So, far I did the following scripts but it throws error that cannot read property 'SetParameter' of undefined. Can anyone please guide how can I change fetchxml of a subgrid?

function listOfOrders(contactId){
    var orderFetchXml = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>"+
                    "  <entity name='salesorder'>"+
                    "    <attribute name='name' />"+
                    "    <attribute name='customerid' />"+
                    "    <attribute name='salesorderid' />"+
                    "    <attribute name='statecode' />"+
                    "    <attribute name='createdon' />"+
                    "    <order attribute='name' descending='false' />"+
                    "    <filter type='and'>"+
                    "      <condition attribute='customerid' operator='eq' uitype='contact' value='"+contactId+"' />"+
                    "    </filter>"+
                    "  </entity>"+
                    "</fetch>";

    var retrievedOrders = XrmServiceToolkit.Soap.Fetch(orderFetchXml);

        var contactId = "";
        if(retrievedOrders.length <0)
            return;

    var viewId = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX";
    var viewDisName = "Account Orders subgridview";

     var layOutXml = "<grid name='resultset' object='1' jump='name' select='1' icon='1' preview='1'>" +
                            "<row name='result' id='salesorderid'>" +
                            "<cell name='name' width='300' />" +
                            "<cell name='statecode' />"+
                            "<cell name='createdon' />"+
                            "<cell name='customerid' />"+
                            "disableSorting='1' />" +
                            "</row>" +
                    "</grid>";
    var orderSubgrid = window.parent.document.getElementById("orderssubgrid");
    //apply layout and filtered fetchXML
    orderSubgrid.control.SetParameter("layoutXml", layOutXml);
    orderSubgrid.control.SetParameter("fetchXml", orderFetchXml);
    //Refresh grid to show filtered records only.
    orderSubgrid.control.Refresh();
}

Body:
Yes you could use a timeout. The code would look like:

function listOfOrders(contactId) {
    var orderSubgrid = window.parent.document.getElementById("orderssubgrid");
    if (orderSubgrid == null) {
        setTimeout(function () { listofOrders(contactId); }, 2000);
        return;
    }
    // ... the rest of your code
}

If you wanted to try a supported method there were new subgrid methods added to Xrm in 2016. You might want to see if it's possible to use setCurrentView.


问:
Feeding text file as standart input
I am trying to write program to called Triangle.java. The program should read  3 Integers from file as standard input and use them as parameters.

I did something like this:

```<code>Scanner input = new Scanner(System.in);
while(input.hasNextLine()) {
  String TestName = input.nextLine();
  int x = input.nextInt();
  int y = input.nextInt();
  int z = input.nextInt();
  .......
}
</code>```

and then I wanted to use x,y and z as parameters. I tried to compile the program on my ubuntu machine using command line  javac Triangle.java<test.txt then run program using java Triangle.class.

Things do not seem to be working. Any suggestion would be highly appreciated.

答:
Okay, a couple of problems with that code, but here's your main problem: You read more than you have

```<code>String TestName=input.nextLine();
int x =input.nextInt();
int y =input.nextInt();
int z =input.nextInt();
</code>```

input.nextLine() will already read the ENTIRE line. So input.nextInt() will try to read ints from the next line yet again of which you don't even know if it exists.

That's not so much a problem with System.in because it will just prompt the user to enter some more ints (though I don't see how the TestName variable will be of any use anyway). But if you're using a file, this will become a problem.

Also, as a side note:

You can't really call input.hasNextLine() on a Scanner using System.in, because at that point in time, there will be no next line in the input stream. You first have to prompt the user to input some more before there will be a line, which means your while will never be executed.

However when you're using a file, obviously the check will work, so you should keep it around anyway.

Title: Feeding text file as standart input

Body:
I am trying to write program to called Triangle.java. The program should read  3 Integers from file as standard input and use them as parameters.

I did something like this:

Scanner input = new Scanner(System.in);
while(input.hasNextLine()) {
  String TestName = input.nextLine();
  int x = input.nextInt();
  int y = input.nextInt();
  int z = input.nextInt();
  .......
}

and then I wanted to use x,y and z as parameters. I tried to compile the program on my ubuntu machine using command line  javac Triangle.java<test.txt then run program using java Triangle.class.

Things do not seem to be working. Any suggestion would be highly appreciated.

Body:
Okay, a couple of problems with that code, but here's your main problem: You read more than you have

String TestName=input.nextLine();
int x =input.nextInt();
int y =input.nextInt();
int z =input.nextInt();

input.nextLine() will already read the ENTIRE line. So input.nextInt() will try to read ints from the next line yet again of which you don't even know if it exists.

That's not so much a problem with System.in because it will just prompt the user to enter some more ints (though I don't see how the TestName variable will be of any use anyway). But if you're using a file, this will become a problem.

Also, as a side note:

You can't really call input.hasNextLine() on a Scanner using System.in, because at that point in time, there will be no next line in the input stream. You first have to prompt the user to input some more before there will be a line, which means your while will never be executed.

However when you're using a file, obviously the check will work, so you should keep it around anyway.


问:
Git: Shallow copies from a specific commit
git clone --depth N ... creates a shallow clone with history limited to the last N revisions and I can use git clone -b tag ... to fetch the commits reachable from tag. However, is there a way to fetch a repository (or a branch thereof) from a specific (tagged) commit up to the branch head?

Say, for example, I'd like to clone only the history starting from a specific release tag. So if the last few commits in the remote look like this

```<code>[master]   ...
[master~1] ...
[master~2] ... <-- tag: x.x
[master~3] ...
...
</code>```

Now I'd like to clone the history range x.x~1.., without having to manually count the number of revisions to give to --depth.

I guess the explanation given in the accepted answer to Why Isn't There A Git Clone Specific Commit Option? applies here as well, so there might not be a direct way.

答:
If running at least Git 2.11 on both client and server side, there's a work-around if you know the date of the tagged commit and which branch it is on:</p>

```<code>git clone --branch <branch that contains tag> --shallow-since=<date of tagged commit> <url>
</code>```

Body:
git clone --depth N ... creates a shallow clone with history limited to the last N revisions and I can use git clone -b tag ... to fetch the commits reachable from tag. However, is there a way to fetch a repository (or a branch thereof) from a specific (tagged) commit up to the branch head?

Say, for example, I'd like to clone only the history starting from a specific release tag. So if the last few commits in the remote look like this

[master]   ...
[master~1] ...
[master~2] ... <-- tag: x.x
[master~3] ...
...

Now I'd like to clone the history range x.x~1.., without having to manually count the number of revisions to give to --depth.

I guess the explanation given in the accepted answer to Why Isn't There A Git Clone Specific Commit Option? applies here as well, so there might not be a direct way.

Body:
If running at least Git 2.11 on both client and server side, there's a work-around if you know the date of the tagged commit and which branch it is on:

git clone --branch <branch that contains tag> --shallow-since=<date of tagged commit> <url>


问:
No such file or directory error using downloadTask in Swift 3
I'm trying to fetch the contents of an URL using the downloadTask background function  on swift 3. Using dataTask, things work as they should. However, when using the downloadTask function, my didCompleteWithError delegate is called. When I check at the response sent by the server, I see that the status code is 200.

Here's the error message:

Optional(Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory" UserInfo={NSErrorFailingURLKey=https://api.met.no/weatherapi/locationforecast/1.9/?lat=59.000;lon=10.000, NSErrorFailingURLStringKey=https://api.met.no/weatherapi/locationforecast/1.9/?lat=59.000;lon=10.000})

My code is:

```<code>let urlo = URL(string: "https://api.met.no/weatherapi/locationforecast/1.9/?lat=59.000;lon=10.000")
var request = URLRequest(url: urlo!)
request.httpMethod = "GET"
let backgroundConfigObject = URLSessionConfiguration.background(withIdentifier: "MYUPDATING")
let backgroundSession = URLSession(configuration: backgroundConfigObject, delegate: self, delegateQueue: OperationQueue.main)
let taskTemps = backgroundSession.downloadTask(with: request)
taskTemps.resume()
</code>```

Can anyone tell me what I'm doing wrong here?

答: This was a bug on XCode. Apparently it got fixed in XCode 8.3. Things work as they should now.</p>

Body:
I'm trying to fetch the contents of an URL using the downloadTask background function  on swift 3. Using dataTask, things work as they should. However, when using the downloadTask function, my didCompleteWithError delegate is called. When I check at the response sent by the server, I see that the status code is 200.

Here's the error message:

Optional(Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory" UserInfo={NSErrorFailingURLKey=https://api.met.no/weatherapi/locationforecast/1.9/?lat=59.000;lon=10.000, NSErrorFailingURLStringKey=https://api.met.no/weatherapi/locationforecast/1.9/?lat=59.000;lon=10.000})

My code is:

let urlo = URL(string: "https://api.met.no/weatherapi/locationforecast/1.9/?lat=59.000;lon=10.000")
var request = URLRequest(url: urlo!)
request.httpMethod = "GET"
let backgroundConfigObject = URLSessionConfiguration.background(withIdentifier: "MYUPDATING")
let backgroundSession = URLSession(configuration: backgroundConfigObject, delegate: self, delegateQueue: OperationQueue.main)
let taskTemps = backgroundSession.downloadTask(with: request)
taskTemps.resume()

Can anyone tell me what I'm doing wrong here?


问:
Open Source .Net Web Registration Form Generator
Anybody know of / have experience with .net web registration form generator, that is free and/or open source?

Something like a very simple version of InfoPath web forms.

答:
AspxFormsGen 3.5 is a tool that
  automatically generates (ASP.Net 3.5
  Generator) ASP.Net 3.5 Standard
  WebForms (.aspx) in C# 3.5 or VB 9.0
  and their accompanying CodeFile
  (.aspx.cs or .aspx.vb). It generates
  WebForms with CRUD (Create, Retrieve,
  Update, Delete) functionalities using
  the latest Linq-to-SQL and
  LinqDataSource, based on the tables in
  your MS SQL 2000/2005 Database, all in
  One Click. Download.

There are some good open source web-based Content Management Systems that has customizable profiling and excellent community contributed modules for free. Some of them are:

Umbraco (Recommended)

Dotnetnuke

ContentLicense: CC BY-SA 2.5


问:
My combobox will only run once
```<code>            from tkinter import *
            from tkinter.ttk import *

            month  = (1,2,3,4,5,6,7,8,9,10,11,12)

            def func1(self,event = None):
                var = self.CB1.get()
                print(var)
                print("Your Birthday is: " + var)

            class app():
                def __init__(self):

                    window = Tk()

                    self.CB1 = Combobox(window,values = month,state = "readonly")
                    self.CB1.current(0)

                    self.CB1.bind("<<ComboboxSelected>>", func1(self,event = None))

                    self.CB1.pack()

                    window.mainloop()

            app()
</code>```

<p>So it will output 1, and say "Your birthday is 1", it will not do it again if I select a different number. I have tried over 10 different pages to understand combo-boxes, and am failing quite hard to understand. Any help would be appreciated. Thank you to all who help. </p>

答:
The @TidB answer about lambda function and why your combobox runs only once is absolutely correct!

But I'm confused by how you built your class and how you passed self and event outside the class. Is it really what you want or are you trying to do something like this?

```<code>try:
    import tkinter as tk
    import tkinter.ttk as ttk
except ImportError:
    import Tkinter as tk
    import ttk

month = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)

class App():
    def __init__(self):
        window = tk.Tk()

        self.CB1 = ttk.Combobox(window, values=month, state="readonly")
        self.CB1.current(0)
        self.CB1.bind("<<ComboboxSelected>>", self.func1)
        self.CB1.pack()

        window.mainloop()

    def func1(self, event=None):
        var = self.CB1.get()
        print(var)
        print("Your Birthday is: " + var)

App()
</code>```

Python passes your self and event for you implicitly, so why're you trying to do a same job?
So I think that a real problem stems from your class's structure. And this is a real cause why your combobox runs only once.

Best way to structure a tkinter application

How to pass arguments to a Button command in Tkinter?

Why is “import *” bad?

Zen

Title: My combobox will only run once

Body:
            from tkinter import *
            from tkinter.ttk import *

            month  = (1,2,3,4,5,6,7,8,9,10,11,12)

            def func1(self,event = None):
                var = self.CB1.get()
                print(var)
                print("Your Birthday is: " + var)

            class app():
                def __init__(self):

                    window = Tk()

                    self.CB1 = Combobox(window,values = month,state = "readonly")
                    self.CB1.current(0)

                    self.CB1.bind("<<ComboboxSelected>>", func1(self,event = None))

                    self.CB1.pack()

                    window.mainloop()

            app()

So it will output 1, and say "Your birthday is 1", it will not do it again if I select a different number. I have tried over 10 different pages to understand combo-boxes, and am failing quite hard to understand. Any help would be appreciated. Thank you to all who help.

Body:
The @TidB answer about lambda function and why your combobox runs only once is absolutely correct!

But I'm confused by how you built your class and how you passed self and event outside the class. Is it really what you want or are you trying to do something like this?

try:
    import tkinter as tk
    import tkinter.ttk as ttk
except ImportError:
    import Tkinter as tk
    import ttk

month = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)

class App():
    def __init__(self):
        window = tk.Tk()

        self.CB1 = ttk.Combobox(window, values=month, state="readonly")
        self.CB1.current(0)
        self.CB1.bind("<<ComboboxSelected>>", self.func1)
        self.CB1.pack()

        window.mainloop()

    def func1(self, event=None):
        var = self.CB1.get()
        print(var)
        print("Your Birthday is: " + var)

App()

Python passes your self and event for you implicitly, so why're you trying to do a same job?
So I think that a real problem stems from your class's structure. And this is a real cause why your combobox runs only once.

Best way to structure a tkinter application

How to pass arguments to a Button command in Tkinter?

Why is “import *” bad?

Zen