玩! dist抛出异常

时间:2013-04-16 07:25:30

标签: scala playframework akka playframework-2.1

我试图创建一个独立版本的Play!应用程序,当我执行play run时,它可以正常工作,但在执行play dist

之后

运行start命令

时出现以下错误

我使用的是play2.1和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 个答案:

答案 0 :(得分:3)

我遇到了同样的问题。确切的解决方法是从

更改依赖关系
"org.skife.com.typesafe.config" % "typesafe-config" % "0.3.0"

"com.typesafe" % "config" % "1.0.0"

答案 1 :(得分:2)

我发现我在build.sbt中使用"org.skife.com.typesafe.config" % "typesafe-config" % "0.3.0",并且播放开始使用com.typesafe.config-1.0.0,删除了skife config 0.3.0的依赖项解决了问题。

似乎这两个依赖关系相互冲突。