3
votes

I m trying to create a standalone version of my Play! application , when I do play run it works fine , but after doing play dist

I get following error when I run the start command

I m using play2.1 and Scala 2.10.0

Oops, cannot start the server.
@6e25l921m: Cannot init the Global object
    at play.api.WithDefaultGlobal$$anonfun$play$api$WithDefaultGlobal$$globalInstance$1.apply(Application.scala:57)
    at play.api.WithDefaultGlobal$$anonfun$play$api$WithDefaultGlobal$$globalInstance$1.apply(Application.scala:51)
    at play.utils.Threads$.withContextClassLoader(Threads.scala:18)
    at play.api.WithDefaultGlobal$class.play$api$WithDefaultGlobal$$globalInstance(Application.scala:50)
    at play.api.DefaultApplication.play$api$WithDefaultGlobal$$globalInstance$lzycompute(Application.scala:383)
    at play.api.DefaultApplication.play$api$WithDefaultGlobal$$globalInstance(Application.scala:383)
    at play.api.WithDefaultGlobal$class.global(Application.scala:66)
    at play.api.DefaultApplication.global(Application.scala:383)
    at play.api.WithDefaultConfiguration$class.play$api$WithDefaultConfiguration$$fullConfiguration(Application.scala:80)
    at play.api.DefaultApplication.play$api$WithDefaultConfiguration$$fullConfiguration$lzycompute(Application.scala:383)
    at play.api.DefaultApplication.play$api$WithDefaultConfiguration$$fullConfiguration(Application.scala:383)
    at play.api.WithDefaultConfiguration$class.configuration(Application.scala:82)
    at play.api.DefaultApplication.configuration(Application.scala:383)
    at play.api.Application$class.$init$(Application.scala:268)
    at play.api.DefaultApplication.(Application.scala:383)
    at play.core.StaticApplication.(ApplicationProvider.scala:52)
    at play.core.server.NettyServer$.createServer(NettyServer.scala:228)
    at play.core.server.NettyServer$$anonfun$main$5.apply(NettyServer.scala:259)
    at play.core.server.NettyServer$$anonfun$main$5.apply(NettyServer.scala:258)
    at scala.Option.map(Option.scala:145)
    at play.core.server.NettyServer$.main(NettyServer.scala:258)
    at play.core.server.NettyServer.main(NettyServer.scala)
Caused by: java.lang.NoSuchMethodError: com.typesafe.config.ConfigFactory.load(Lcom/typesafe/config/ConfigParseOptions;)Lcom/typesafe/config/Config;
    at play.api.Configuration$.dontAllowMissingConfig$lzycompute(Configuration.scala:25)
    at play.api.Configuration$.dontAllowMissingConfig(Configuration.scala:25)
    at play.api.Configuration$.load(Configuration.scala:59)
    at play.api.WithDefaultConfiguration$$anonfun$initialConfiguration$1.apply(Application.scala:74)
    at play.api.WithDefaultConfiguration$$anonfun$initialConfiguration$1.apply(Application.scala:74)
    at play.utils.Threads$.withContextClassLoader(Threads.scala:18)
    at play.api.WithDefaultConfiguration$class.initialConfiguration(Application.scala:73)
    at play.api.DefaultApplication.initialConfiguration$lzycompute(Application.scala:383)
    at play.api.DefaultApplication.initialConfiguration(Application.scala:383)
    at play.api.WithDefaultGlobal$class.play$api$WithDefaultGlobal$$globalClass(Application.scala:24)
    at play.api.DefaultApplication.play$api$WithDefaultGlobal$$globalClass$lzycompute(Application.scala:383)
    at play.api.DefaultApplication.play$api$WithDefaultGlobal$$globalClass(Application.scala:383)
    at play.api.WithDefaultGlobal$class.play$api$WithDefaultGlobal$$javaGlobal(Application.scala:30)
    at play.api.DefaultApplication.play$api$WithDefaultGlobal$$javaGlobal$lzycompute(Application.scala:383)
    at play.api.DefaultApplication.play$api$WithDefaultGlobal$$javaGlobal(Application.scala:383)
    at play.api.WithDefaultGlobal$$anonfun$play$api$WithDefaultGlobal$$globalInstance$1.apply(Application.scala:52)
    ... 21 more
2

2 Answers

3
votes

I ran into the same issue. The exact fix was to change a dependency from

"org.skife.com.typesafe.config" % "typesafe-config" % "0.3.0"

to

"com.typesafe" % "config" % "1.0.0"
2
votes

I figured out that I was using "org.skife.com.typesafe.config" % "typesafe-config" % "0.3.0" in the build.sbt , and the play start was using com.typesafe.config-1.0.0, removing the dependency for skife config 0.3.0 solved the problem.

seems like these 2 dependencies conflict with each other.