com.typesafe.config.ConfigException $ Missing:找不到关键'播放&{39;

时间:2015-06-18 21:35:11

标签: scala playframework key config typesafe

我在一个sbt项目中工作,我正在使用库play-ws 但是我的应用程序没有使用框架。

所以,当我运行mi Job时,我有这个错误:

  

com.typesafe.config.ConfigException $ Missing:没有配置设置   找到关键' play'

     

com.typesafe.config.ConfigException $ Missing:没有配置设置   找到关键的游戏'在   com.typesafe.config.impl.SimpleConfig.findKey(SimpleConfig.java:124)     在com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:145)     在com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:159)     在com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:164)     在   com.typesafe.config.impl.SimpleConfig.getObject(SimpleConfig.java:218)     在   com.typesafe.config.impl.SimpleConfig.getConfig(SimpleConfig.java:224)     在   com.typesafe.config.impl.SimpleConfig.getConfig(SimpleConfig.java:33)     在   play.core.Invoker $$不久$ 1.play $核心$祈求$$匿名$$ loadActorConfig(Invoker.scala:35)     在play.core.Invoker $$ anon $ 1 $$ anonfun $ 3.apply(Invoker.scala:23)at at   play.core.Invoker $$ anon $ 1 $$ anonfun $ 3.apply(Invoker.scala:21)at at   scala.Option.getOrElse(Option.scala:120)at   play.core.Invoker $$ anon $ 1.create(Invoker.scala:21)at   play.core.ClosableLazy.get(ClosableLazy.scala:51)at   play.core.Invoker $ .system(Invoker.scala:40)at   play.core.Invoker $ .executionContext(Invoker.scala:41)at   play.api.libs.concurrent.Execution $ .defaultContext(Execution.scala:15)     在   play.api.libs.concurrent.Execution $ Implicits $ .defaultContext(Execution.scala:12)     在   play.api.libs.ws.ning.NingWSRequest $$匿名$ 2.onBodyPartReceived(NingWS.scala:322)无   找到关键字'的配置设置在   com.ning.http.client.providers.netty.NettyAsyncHttpProvider.updateBodyAndInterrupt(NettyAsyncHttpProvider.java:1568)

     

在   com.ning.http.client.providers.netty.NettyAsyncHttpProvider.access $ 2900(NettyAsyncHttpProvider.java:161)     在   com.ning.http.client.providers.netty.NettyAsyncHttpProvider $ HttpProtocol.handle(NettyAsyncHttpProvider.java:2233)     在   com.ning.http.client.providers.netty.NettyAsyncHttpProvider.messageReceived(NettyAsyncHttpProvider.java:1227)     在   org.jboss.netty.handler.stream.ChunkedWriteHandler.handleUpstream(ChunkedWriteHandler.java:142)     在   org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296)     在   org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:459)     在   org.jboss.netty.handler.codec.replay.ReplayingDecoder.callDecode(ReplayingDecoder.java:536)     在   org.jboss.netty.handler.codec.replay.ReplayingDecoder.messageReceived(ReplayingDecoder.java:435)     在   org.jboss.netty.handler.codec.http.HttpClientCodec.handleUpstream(HttpClientCodec.java:92)     在   org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268)     在   org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255)     在   org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88)     在   org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:108)     在   org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:318)     在   org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89)     在   org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)     在   java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)     在   java.util.concurrent.ThreadPoolExecutor中的$ Worker.run(ThreadPoolExecutor.java:615)     在java.lang.Thread.run(Thread.java:724)

(我使用sby程序集制作jar并在spark job-server中执行作业) 我在工作中不使用文件配置(application.conf,reference.conf等)。

请帮帮我。

1 个答案:

答案 0 :(得分:10)

我不知道造成这个问题的原因。

以下修正了它:

val parsedConfig = ConfigFactory.parseFile(new File("src/main/resources/application.conf"))

val conf = ConfigFactory.load(parsedConfig)
相关问题