"play.http.session.cookieName" configuration let Play and Injection crash on dist

128 views
Skip to first unread message

Simon Jacobs

unread,
Sep 1, 2016, 3:59:35 AM9/1/16
to Play Framework
Hey guys,

we developed an play application (Currently 2.5.6, startimg with play 2.4) and it worked like a charm.

Some days ago I added a configuration line to application.conf:

session.cookieName =SESSION

On server start play told me that this config is deprecated and it should change to a new one:

[application] - application.conf @ file:/home/custom/app/webapp/custom-webapp-0.6.0/conf/application.conf: 28: session.cookieName is deprecated, use play.http.session.cookieName instead

Fine. So I remove the old config and added the new one:

play.http.session.cookieName =SESSION
During development process all works fine, but wenn I build a new relase two days ago with

activator clean dist

and start the server with

custom-webapp/bin/custom-webapp  -Dconfig.file=./develop.conf  -Dlogger.file=/home/custom/app/webapp/logback-develop.xml

the server could not start due to a NPE while accessing the database (db() in com.avaje.ebean.Model.java is null) in the Initializer (Custom class according to Play docs to create some database entries on startup if database is empty. Called via @Inject from the Filters class).


Strange fact part I:

If I remove the play.http.session.cookieName the error still occurs, only reAdd the session.cookieName line helps the server to startup. I rolled back the commits.

Strange fact part II:

Starting the server in development mode (activaor ~run) doesn't result in an NPE

I checked the logfiles and it seems that, if the play.http.session.cookieName is added to the application.conf the Initializer is called 3 times instead of one-time! Below are the 2 log files. First without the play.htttp.session.cookieName and the second with. The lines

2016-09-01 09:04:25,278 [info] [application] - Initializer reached
2016-09-01 09:04:25,278 [info] [application] - Check for initial data

are logged from the initilaizer. If the Initializer has been processed completetly the line

2016-09-01 09:04:25,359 [info] [application] - The application is now properly configured

will be logged. So we see the first two lines 3 times, the last line only one-time.

I have really no idea what is going on here, I am appreciate for any suggests or help.

With best regards
Simon

Without the play.http.session.cookie.name (But with session.cookieName)


2016-09-01 09:23:09,772 [info] [application] - Creating Pool for datasource 'default'
2016-09-01 09:23:09,798 [info] [com.zaxxer.hikari.HikariDataSource] - HikariPool-1 - Started.
2016-09-01 09:23:10,102 [info] [org.jdbcdslog.ConnectionLogger] - connect to URL jdbc:mysql://127.0.0.1/Custom_050?useUnicode=yes&characterEncoding=UTF-8 for user root@localhost
2016-09-01 09:23:10,115 [info] [org.jdbcdslog.ConnectionLogger] - connect to URL jdbc:mysql://127.0.0.1/Custom_050?useUnicode=yes&characterEncoding=UTF-8 for user root@localhost
2016-09-01 09:23:10,121 [info] [play.api.db.DefaultDBApi] - Database [default] connected at jdbc:mysql://127.0.0.1/Custom_050?useUnicode=yes&characterEncoding=UTF-8
2016-09-01 09:23:10,405 [info] [org.reflections.Reflections] - Reflections took 158 ms to scan 2 urls, producing 32 keys and 658 values
2016-09-01 09:23:10,447 [info] [org.jdbcdslog.ConnectionLogger] - connect to URL jdbc:mysql://127.0.0.1/Custom_050?useUnicode=yes&characterEncoding=UTF-8 for user root@localhost
2016-09-01 09:23:10,453 [info] [org.jdbcdslog.ConnectionLogger] - connect to URL jdbc:mysql://127.0.0.1/Custom_050?useUnicode=yes&characterEncoding=UTF-8 for user root@localhost
2016-09-01 09:23:10,459 [info] [com.avaje.ebeaninternal.server.core.DefaultContainer] - DatabasePlatform name:default platform:mysql
2016-09-01 09:23:10,654 [info] [com.avaje.ebeaninternal.server.deploy.BeanDescriptorManager] - Entities enhanced[10]
2016-09-01 09:23:11,219 [info] [akka.event.slf4j.Slf4jLogger] - Slf4jLogger started
2016-09-01 09:23:11,231 [debug] [play.api.libs.concurrent.ActorSystemProvider] - Starting application default Akka system: application
2016-09-01 09:23:12,060 [info] [com.ticketfly.play.liquibase.PlayLiquibase] - Running liquibase migrations
2016-09-01 09:23:12,210 [info] [liquibase] - Successfully acquired change log lock
2016-09-01 09:23:13,280 [info] [liquibase] - Reading from DATABASECHANGELOG
2016-09-01 09:23:13,410 [info] [liquibase] - Successfully released change log lock
2016-09-01 09:23:13,481 [warn] [application] - application.conf @ file:/home/Custom/app/webapp/Custom-webapp-0.6.0/conf/application.conf: 28: session.cookieName is deprecated, use play.http.session.cookieName instead
2016-09-01 09:23:13,716 [info] [org.hibernate.validator.internal.util.Version] - HV000001: Hibernate Validator 5.2.4.Final
2016-09-01 09:23:13,818 [info] [application] - Redis Plugin enabled. Connecting to Redis on localhost:6379 to 0 with timeout 2000.
2016-09-01 09:23:13,827 [info] [application] - Redis Plugin pool configuration: redis.clients.jedis.JedisPoolConfig@5112b7[maxTotal=8,maxIdle=8,minIdle=0,lifo=true,maxWaitMillis=-1,minEvictableIdleTimeMillis=60000,softMinEvictableIdleTimeMillis=1800000,numTestsPerEvictionRun=-1,evictionPolicyClassName=org.apache.commons.pool2.impl.DefaultEvictionPolicy,testOnBorrow=false,testOnReturn=false,testWhileIdle=true,timeBetweenEvictionRunsMillis=30000,blockWhenExhausted=true,jmxEnabled=true,jmxNamePrefix=pool]
2016-09-01 09:23:13,876 [info] [redis.module] - Starting Jedis Pool Provider
2016-09-01 09:23:13,938 [info] [org.elasticsearch.plugins] - [Venus] modules [], plugins [], sites []
2016-09-01 09:23:14,693 [info] [application] - Initializer reached
2016-09-01 09:23:14,694 [info] [application] - Check for initial data
2016-09-01 09:23:14,707 [info] [org.jdbcdslog.ConnectionLogger] - connect to URL jdbc:mysql://127.0.0.1/Custom_050?useUnicode=yes&characterEncoding=UTF-8 for user root@localhost
2016-09-01 09:23:14,753 [info] [org.jdbcdslog.StatementLogger] - select count(*) from user t0;
2016-09-01 09:23:14,770 [info] [org.jdbcdslog.ResultSetLogger] - java.sql.ResultSet.next {11}
2016-09-01 09:23:14,771 [trace] [org.avaje.ebean.SQL] - txn[1001] select count(*) from user t0; --bind()
2016-09-01 09:23:14,771 [debug] [org.avaje.ebean.SUM] - txn[1001] FindRowCount exeMicros[45023] rows[11] type[models.user.User] predicates[] bind[]
2016-09-01 09:23:14,772 [info] [application] - The application is now properly configured
2016-09-01 09:23:14,806 [info] [play.api.Play] - Application started (Prod)
2016-09-01 09:23:14,937 [info] [play.core.server.NettyServer] - Listening for HTTP on /0:0:0:0:0:0:0:0%0:9000

With play.http.session.cookie.name (And without session.cookieName).

2016-09-01 09:04:20,324 [info] [application] - Creating Pool for datasource 'default'
2016-09-01 09:04:20,350 [info] [com.zaxxer.hikari.HikariDataSource] - HikariPool-1 - Started.
2016-09-01 09:04:20,672 [info] [org.jdbcdslog.ConnectionLogger] - connect to URL jdbc:mysql://127.0.0.1/custom_050?useUnicode=yes&characterEncoding=UTF-8 for user root@localhost
2016-09-01 09:04:20,684 [info] [org.jdbcdslog.ConnectionLogger] - connect to URL jdbc:mysql://127.0.0.1/custom_050?useUnicode=yes&characterEncoding=UTF-8 for user root@localhost
2016-09-01 09:04:20,685 [info] [play.api.db.DefaultDBApi] - Database [default] connected at jdbc:mysql://127.0.0.1/custom_050?useUnicode=yes&characterEncoding=UTF-8
2016-09-01 09:04:21,137 [info] [org.hibernate.validator.internal.util.Version] - HV000001: Hibernate Validator 5.2.4.Final
2016-09-01 09:04:21,525 [info] [akka.event.slf4j.Slf4jLogger] - Slf4jLogger started
2016-09-01 09:04:21,537 [debug] [play.api.libs.concurrent.ActorSystemProvider] - Starting application default Akka system: application
2016-09-01 09:04:21,561 [info] [application] - Redis Plugin enabled. Connecting to Redis on localhost:6379 to 0 with timeout 2000.
2016-09-01 09:04:21,570 [info] [application] - Redis Plugin pool configuration: redis.clients.jedis.JedisPoolConfig@43d38654[maxTotal=8,maxIdle=8,minIdle=0,lifo=true,maxWaitMillis=-1,minEvictableIdleTimeMillis=60000,softMinEvictableIdleTimeMillis=1800000,numTestsPerEvictionRun=-1,evictionPolicyClassName=org.apache.commons.pool2.impl.DefaultEvictionPolicy,testOnBorrow=false,testOnReturn=false,testWhileIdle=true,timeBetweenEvictionRunsMillis=30000,blockWhenExhausted=true,jmxEnabled=true,jmxNamePrefix=pool]
2016-09-01 09:04:21,639 [info] [redis.module] - Starting Jedis Pool Provider
2016-09-01 09:04:22,133 [info] [org.elasticsearch.plugins] - [Chi Demon] modules [], plugins [], sites []
2016-09-01 09:04:22,742 [info] [application] - Initializer reached
2016-09-01 09:04:22,743 [info] [application] - Check for initial data
2016-09-01 09:04:22,770 [info] [application] - Initializer reached
2016-09-01 09:04:22,770 [info] [application] - Check for initial data
2016-09-01 09:04:22,869 [info] [org.reflections.Reflections] - Reflections took 51 ms to scan 2 urls, producing 32 keys and 658 values
2016-09-01 09:04:22,918 [info] [org.jdbcdslog.ConnectionLogger] - connect to URL jdbc:mysql://127.0.0.1/custom_050?useUnicode=yes&characterEncoding=UTF-8 for user root@localhost
2016-09-01 09:04:22,924 [info] [org.jdbcdslog.ConnectionLogger] - connect to URL jdbc:mysql://127.0.0.1/custom_050?useUnicode=yes&characterEncoding=UTF-8 for user root@localhost
2016-09-01 09:04:22,930 [info] [com.avaje.ebeaninternal.server.core.DefaultContainer] - DatabasePlatform name:default platform:mysql
2016-09-01 09:04:23,140 [info] [com.avaje.ebeaninternal.server.deploy.BeanDescriptorManager] - Entities enhanced[10]
2016-09-01 09:04:23,627 [info] [com.ticketfly.play.liquibase.PlayLiquibase] - Running liquibase migrations
2016-09-01 09:04:23,744 [info] [liquibase] - Successfully acquired change log lock
2016-09-01 09:04:24,779 [info] [liquibase] - Reading from DATABASECHANGELOG
2016-09-01 09:04:24,972 [info] [liquibase] - Successfully released change log lock
2016-09-01 09:04:25,278 [info] [application] - Initializer reached
2016-09-01 09:04:25,278 [info] [application] - Check for initial data
2016-09-01 09:04:25,291 [info] [org.jdbcdslog.ConnectionLogger] - connect to URL jdbc:mysql://127.0.0.1/custom_050?useUnicode=yes&characterEncoding=UTF-8 for user root@localhost
2016-09-01 09:04:25,342 [info] [org.jdbcdslog.StatementLogger] - select count(*) from user t0;
2016-09-01 09:04:25,355 [info] [org.jdbcdslog.ResultSetLogger] - java.sql.ResultSet.next {11}
2016-09-01 09:04:25,356 [trace] [org.avaje.ebean.SQL] - txn[1001] select count(*) from user t0; --bind()
2016-09-01 09:04:25,356 [debug] [org.avaje.ebean.SUM] - txn[1001] FindRowCount exeMicros[39885] rows[11] type[models.user.User] predicates[] bind[]
2016-09-01 09:04:25,357 [info] [application] - STart for checking for Predefined Tags
2016-09-01 09:04:25,357 [info] [org.jdbcdslog.ConnectionLogger] - connect to URL jdbc:mysql://127.0.0.1/custom_050?useUnicode=yes&characterEncoding=UTF-8 for user root@localhost
2016-09-01 09:04:25,358 [info] [org.jdbcdslog.StatementLogger] - select count(*) from predefined_tag t0;
2016-09-01 09:04:25,359 [info] [org.jdbcdslog.ResultSetLogger] - java.sql.ResultSet.next {3}
2016-09-01 09:04:25,359 [trace] [org.avaje.ebean.SQL] - txn[1002] select count(*) from predefined_tag t0; --bind()
2016-09-01 09:04:25,359 [debug] [org.avaje.ebean.SUM] - txn[1002] FindRowCount exeMicros[770] rows[3] type[models.tag.PredefinedTag] predicates[] bind[]
2016-09-01 09:04:25,359 [info] [application] - The application is now properly configured
Oops, cannot start the server.
com
.google.inject.CreationException: Unable to create injector, see the following errors:

1) Error injecting constructor, java.lang.NullPointerException
  at config
.CustomInitializer.<init>(CustomInitializer.java:45)
  at config
.CustomInitializer.class(CustomInitializer.java:42)
 
while locating config.CustomInitializer
   
for field at Filters.initializer(Filters.java:12)
 
while locating Filters
 
while locating play.http.HttpFilters
   
for parameter 0 at play.api.http.JavaHttpFiltersAdapter.<init>(HttpFilters.scala:63)
 
while locating play.api.http.JavaHttpFiltersAdapter
 
while locating play.api.http.HttpFilters
   
for parameter 3 at play.api.http.JavaCompatibleHttpRequestHandler.<init>(HttpRequestHandler.scala:200)
 
while locating play.api.http.JavaCompatibleHttpRequestHandler
 
while locating play.api.http.HttpRequestHandler
   
for parameter 4 at play.api.DefaultApplication.<init>(Application.scala:221)
  at play
.api.DefaultApplication.class(Application.scala:221)
 
while locating play.api.DefaultApplication
 
while locating play.api.Application
Caused by: java.lang.NullPointerException
    at com
.avaje.ebean.Model$Find.query(Model.java:547)
    at com
.avaje.ebean.Model$Find.findRowCount(Model.java:675)
    at config
.CustomInitializer.createInitialData(CustomInitializer.java:119)
    at config
.CustomInitializer.<init>(CustomInitializer.java:47)
    at config
.CustomInitializer$$FastClassByGuice$$75b85336.newInstance(<generated>)
    at com
.google.inject.internal.cglib.reflect.$FastConstructor.newInstance(FastConstructor.java:40)
    at com
.google.inject.internal.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:61)
    at com
.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:105)
    at com
.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85)
    at com
.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:267)
    at com
.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
    at com
.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103)
    at com
.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
    at com
.google.inject.internal.SingletonScope$1.get(SingletonScope.java:145)
    at com
.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
    at com
.google.inject.internal.SingleFieldInjector.inject(SingleFieldInjector.java:54)
    at com
.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:132)
    at com
.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:114)
    at com
.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85)
    at com
.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:267)
    at com
.google.inject.internal.FactoryProxy.get(FactoryProxy.java:56)
    at com
.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:38)
    at com
.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:62)
    at com
.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:104)
    at com
.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85)
    at com
.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:267)
    at com
.google.inject.internal.FactoryProxy.get(FactoryProxy.java:56)
    at com
.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:38)
    at com
.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:62)
    at com
.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:104)
    at com
.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85)
    at com
.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:267)
    at com
.google.inject.internal.FactoryProxy.get(FactoryProxy.java:56)
    at com
.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:38)
    at com
.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:62)
    at com
.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:104)
    at com
.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85)
    at com
.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:267)
    at com
.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
    at com
.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103)
    at com
.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
    at com
.google.inject.internal.SingletonScope$1.get(SingletonScope.java:145)
    at com
.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
    at com
.google.inject.internal.FactoryProxy.get(FactoryProxy.java:56)
    at com
.google.inject.internal.InternalInjectorCreator$1.call(InternalInjectorCreator.java:205)
    at com
.google.inject.internal.InternalInjectorCreator$1.call(InternalInjectorCreator.java:199)
    at com
.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
    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:96)
    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:123)
    at play
.api.inject.guice.GuiceApplicationLoader.load(GuiceApplicationLoader.scala:21)
    at play
.core.server.ProdServerStart$.start(ProdServerStart.scala:47)
    at play
.core.server.ProdServerStart$.main(ProdServerStart.scala:22)
    at play
.core.server.ProdServerStart.main(ProdServerStart.scala)

2) Error injecting constructor, java.lang.NullPointerException
  at config
.CustomInitializer.<init>(CustomInitializer.java:45)
  at config
.CustomInitializer.class(CustomInitializer.java:42)
 
while locating config.CustomInitializer
   
for field at Filters.initializer(Filters.java:12)
 
while locating Filters
 
while locating play.http.HttpFilters
   
for parameter 0 at play.api.http.JavaHttpFiltersAdapter.<init>(HttpFilters.scala:63)
 
while locating play.api.http.JavaHttpFiltersAdapter
 
while locating play.api.http.HttpFilters
   
for parameter 3 at play.api.http.JavaCompatibleHttpRequestHandler.<init>(HttpRequestHandler.scala:200)
 
while locating play.api.http.JavaCompatibleHttpRequestHandler
 
while locating play.api.http.HttpRequestHandler
   
for parameter 4 at play.api.DefaultApplication.<init>(Application.scala:221)
  at play
.api.DefaultApplication.class(Application.scala:221)
 
while locating play.api.DefaultApplication
 
while locating play.api.Application
   
for parameter 0 at play.DefaultApplication.<init>(DefaultApplication.java:30)
  at play
.DefaultApplication.class(DefaultApplication.java:30)
 
while locating play.DefaultApplication
 
while locating play.Application
Caused by: java.lang.NullPointerException
    at com
.avaje.ebean.Model$Find.query(Model.java:547)
    at com
.avaje.ebean.Model$Find.findRowCount(Model.java:675)
    at config
.CustomInitializer.createInitialData(CustomInitializer.java:119)
    at config
.CustomInitializer.<init>(CustomInitializer.java:47)
    at config
.CustomInitializer$$FastClassByGuice$$75b85336.newInstance(<generated>)
    at com
.google.inject.internal.cglib.reflect.$FastConstructor.newInstance(FastConstructor.java:40)
    at com
.google.inject.internal.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:61)
    at com
.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:105)
    at com
.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85)
    at com
.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:267)
    at com
.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
    at com
.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103)
    at com
.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
    at com
.google.inject.internal.SingletonScope$1.get(SingletonScope.java:145)
    at com
.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
    at com
.google.inject.internal.SingleFieldInjector.inject(SingleFieldInjector.java:54)
    at com
.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:132)
    at com
.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:114)
    at com
.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85)
    at com
.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:267)
    at com
.google.inject.internal.FactoryProxy.get(FactoryProxy.java:56)
    at com
.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:38)
    at com
.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:62)
    at com
.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:104)
    at com
.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85)
    at com
.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:267)
    at com
.google.inject.internal.FactoryProxy.get(FactoryProxy.java:56)
    at com
.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:38)
    at com
.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:62)
    at com
.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:104)
    at com
.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85)
    at com
.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:267)
    at com
.google.inject.internal.FactoryProxy.get(FactoryProxy.java:56)
    at com
.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:38)
    at com
.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:62)
    at com
.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:104)
    at com
.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85)
    at com
.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:267)
    at com
.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
    at com
.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103)
    at com
.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
    at com
.google.inject.internal.SingletonScope$1.get(SingletonScope.java:145)
    at com
.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
    at com
.google.inject.internal.FactoryProxy.get(FactoryProxy.java:56)
    at com
.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:38)
    at com
.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:62)
    at com
.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:104)
    at com
.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85)
    at com
.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:267)
    at com
.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
    at com
.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103)
    at com
.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
    at com
.google.inject.internal.SingletonScope$1.get(SingletonScope.java:145)
    at com
.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
    at com
.google.inject.internal.FactoryProxy.get(FactoryProxy.java:56)
    at com
.google.inject.internal.InternalInjectorCreator$1.call(InternalInjectorCreator.java:205)
    at com
.google.inject.internal.InternalInjectorCreator$1.call(InternalInjectorCreator.java:199)
    at com
.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
    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:96)
    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:123)
    at play
.api.inject.guice.GuiceApplicationLoader.load(GuiceApplicationLoader.scala:21)
    at play
.core.server.ProdServerStart$.start(ProdServerStart.scala:47)
    at play
.core.server.ProdServerStart$.main(ProdServerStart.scala:22)
    at play
.core.server.ProdServerStart.main(ProdServerStart.scala)

2 errors
    at com
.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:466)
    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:96)
    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:123)
    at play
.api.inject.guice.GuiceApplicationLoader.load(GuiceApplicationLoader.scala:21)
    at play
.core.server.ProdServerStart$.start(ProdServerStart.scala:47)
    at play
.core.server.ProdServerStart$.main(ProdServerStart.scala:22)
    at play
.core.server.ProdServerStart.main(ProdServerStart.scala)




Greg Methvin

unread,
Sep 1, 2016, 4:37:33 AM9/1/16
to play-framework
I'm pretty unfamiliar with ebean, but is the db() a static method that requires some initialization to work? What guarantees that this initialization has happened?

It's possible this isn't directly because of the configuration change, but rather a slight difference in the timing of initialization.

--
You received this message because you are subscribed to the Google Groups "Play Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/3d506448-8a21-416c-a2df-13e6c43ff1f7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Greg Methvin
Senior Software Engineer

Message has been deleted

Simon Jacobs

unread,
Sep 1, 2016, 5:34:21 AM9/1/16
to Play Framework
Mhm, Google deleted my post - again:

Hey Greg,

I'm pretty unfamiliar with ebean, but is the db() a static method that requires some initialization to work? What guarantees that this initialization has happened?
I think this should be happen during some "dependency initialization" phase. db() returns an Ebean Server which will be created inside a synchronized block.  Maybe Guice is triggered too early so it will instanciate its Singleton (The CustomInitializer) three times instead of one-time, and as far as I understand the 2.5. docs the Initializer can be used to fill the database with seed data.

It's possible this isn't directly because of the configuration change, but rather a slight difference in the timing of initialization. 

Yes - I think is just a symptom. In fact something in the Lifecycle has been changed after adding the config. And there has to be a difference between development mode (~run) and release mode (dist).

Thanks and best regards
Simon

Simon Jacobs

unread,
Sep 1, 2016, 11:53:37 AM9/1/16
to Play Framework
I checked an very early version of our software and I can see a similiar problem.

We included liquibase, which will migrate the database on startup. It seems, that if there is no database and liquibase has to create the new one the lifecycle of play is too fast, so the Initializer is called too often. If there are complex tasks for play (like actor module, cookie name etc.) liquibase has enough time to migrate and let the jdbc opens a connection.

Otherwise the first two calls to the CustomInitializer results in an Timeout (from the synchronized block) and then in an Exception.

So it seems to me, that "something"  in the lifecycle with Play, Guice, Liquibase is broken.

Regards
Reply all
Reply to author
Forward
0 new messages