Skip to content

Commit

Permalink
webapi: force eager creation of beans
Browse files Browse the repository at this point in the history
In spring 6.2.x there are some additional checks about
creating singletons in multiple threads. This would
sometimes get triggered by the database getting created
in another thread for the actor.
  • Loading branch information
brharrington committed Feb 10, 2025
1 parent 525159d commit c9dcdff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ class ActorService(
classOf[Config] -> config,
classOf[Registry] -> registry
).withDefaultValue(null)
// Force eager loading of dependencies to avoid locking issues with singleton beans
classFactory.verifyDependencies(cls, bindings.asJava)
val props = Props(classFactory.newInstance[Actor](cls, bindings.asJava))
val routerCfgPath = s"pekko.actor.deployment./$name.router"
if (config.hasPath(routerCfgPath)) FromConfig.props(props) else props
Expand Down
2 changes: 1 addition & 1 deletion project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ object Dependencies {
object Versions {
val pekko = "1.1.2"
val pekkoHttpV = "1.1.0"
val iep = "5.0.30"
val iep = "5.0.31"
val jackson = "2.18.2"
val log4j = "2.24.3"
val scala = "2.13.16"
Expand Down

0 comments on commit c9dcdff

Please sign in to comment.