Double "Started database"

22 views
Skip to first unread message

Loïc Calvez

unread,
Aug 8, 2025, 5:47:14 AMAug 8
to Ebean ORM

Hi,

I upgraded from Play 2.7.7 / Ebean 11.33.2 to Play 2.8.18 / Ebean 12.16.1, and I’m encountering an issue when launching batch jobs that didn’t happen before.


The batch fails with the following stack trace:

2025-08-08 10:57:04,960 [main] INFO  f.r.playcore.security.SecurityModule - Enregistrement du Module de Sécurité
2025-08-08 10:57:06,919 [main] INFO  play.api.db.DefaultDBApi - Database [default] initialized
2025-08-08 10:57:06,935 [main] INFO  play.api.db.HikariCPConnectionPool - Creating Pool for datasource 'default'
2025-08-08 10:57:06,983 [main] INFO  com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Starting...
2025-08-08 10:57:07,010 [main] INFO  com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Start completed.
2025-08-08 10:57:07,423 [application-akka.actor.default-dispatcher-6] INFO  akka.event.slf4j.Slf4jLogger - Slf4jLogger started
2025-08-08 10:57:08,800 [main] INFO  swagger - Swagger: starting initialization
2025-08-08 10:57:09,123 [main] INFO  swagger - Swagger: initialization done
2025-08-08 10:57:09,188 [main] INFO  io.ebean - ebean version: 12.16.1
2025-08-08 10:57:09,236 [main] INFO  io.avaje.config - Loaded properties from []  
2025-08-08 10:57:09,536 [main] INFO  org.reflections.Reflections - Reflections took 179 ms to scan 2 urls, producing 545 keys and 12467 values
2025-08-08 10:57:10,468 [main] INFO  io.ebean.core - Started database[default] platform[POSTGRES] in 821ms
2025-08-08 10:57:10,608 [main] INFO  io.ebean.core - Started database[default] platform[POSTGRES] in 96ms
2025-08-08 10:57:10,623 [main] INFO  b.o.d.j.TemplateFailureListenerProvider - No custom TemplateFailureListener found, falling back to no-op implementation.  Don't worry, this is a feature and not a bug.
2025-08-08 10:57:10,623 [main] INFO  b.o.deadbolt.java.ViewSupport - Default timeout period for blocking views is [1000]ms
2025-08-08 10:57:10,668 [main] INFO  modules.ApplicationStartUp - Exécution des tâches de démarrage de l'application...
2025-08-08 10:57:10,671 [main] ERROR modules.ApplicationStartUp - Erreur lors de l'exécution des tâches de démarrage de l'application.
2025-08-08 10:57:10,673 [main] ERROR modules.ApplicationStartUp - Could not initialize class io.ebean.DB java.lang.NoClassDefFoundError: Could not initialize class io.ebean.DB
at services.InitDbService.insertData(InitDbService.java:84)
at modules.ApplicationStartUp.<init>(ApplicationStartUp.java:80)
at modules.ApplicationStartUp$$FastClassByGuice$$361333995.GUICE$TRAMPOLINE(<generated>)
at modules.ApplicationStartUp$$FastClassByGuice$$361333995.apply(<generated>)
at com.google.inject.internal.DefaultConstructionProxyFactory$FastClassProxy.newInstance(DefaultConstructionProxyFactory.java:82)
at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:114)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:91)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:296)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:169)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:45)
at com.google.inject.internal.InternalInjectorCreator.loadEagerSingletons(InternalInjectorCreator.java:213)
at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:186)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:113)
at com.google.inject.Guice.createInjector(Guice.java:87)
at com.google.inject.Guice.createInjector(Guice.java:78)
at play.api.inject.guice.GuiceBuilder.injector(GuiceInjectorBuilder.scala:200)
at play.inject.guice.GuiceBuilder.injector(GuiceBuilder.java:211)
at play.inject.guice.GuiceApplicationBuilder.build(GuiceApplicationBuilder.java:121)
at utils.batch.BatchUtils.executeBatch(BatchUtils.java:75)
at batch.ExportBatchApp.main(ExportBatchApp.java:21)


The common point in all failed startups is the line “Started database[default]”, and the second one is very quick (<100ms). I looked into Ebean’s code to try to understand what this might correspond to, but it’s a bit hard to figure out.


Does this error ring a bell? Could it be that Ebean is being initialized twice? Or that Play is initializing Ebean twice? What are the possible leads to investigate to resolve this issue?


Thanks


Loïc.

Rob Bygrave

unread,
Sep 17, 2025, 4:56:15 PM (12 days ago) Sep 17
to Ebean ORM
Are you able to start with a debugger? 

I think there are 2 things going on here.  One is that yes it looks like it is trying to start ebean twice? and the other is that:

 NoClassDefFoundError: Could not initialize class io.ebean.DB

... this exception is "hiding" another underlying exception that we can't see / isn't being reported. So we need to try find that exception that is stopping io.ebean.DB from initialising.
Reply all
Reply to author
Forward
0 new messages