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

Ale*_*lex 7 scala config key playframework typesafe

我在一个sbt项目中工作,我正在使用库play-ws.
但我的应用程序不播放框架.

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

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

com.typesafe.config.ConfigException $ Missing:在com.typesafe.config.impl.SimpleConfig.find的com.typesafe.config.impl.SimpleConfig.findKey(SimpleConfig.java:124)中找不到键'play'的配置设置. (SimpleConfig.java:145)位于com.typesafeafe的com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:159)的com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:164). config.impl.SimpleConfig.getObject(SimpleConfig.java:218)at com.typesafe.config.impl.SimpleConfig.getConfig(SimpleConfig.java:224)at com.typesafe.config.impl.SimpleConfig.getConfig(SimpleConfig.java: 33)在play.core.Invoker $$ anon $ 1.play $ core $ Invoker $$ anon $$ loadActorConfig(Invoker.scala:35)at play.core.Invoker $$ anon $ 1 $$ anonfun $ 3.apply(Invoker. scala:23)at play.core.Invoker $$ anon $ 1 $$ anonfun $ 3.apply(Invoker.scala:21)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)at play.api.libs.concurrent.Execution $在play.api.libs.ws.ning.NingWSRequest $$ anon $ 2.onBodyPartReceived(NingWS.scala:322)上隐含$ .defaultContext(Execution.scala:12)在com.ning中找不到关键字'play'的配置设置. http.client.providers.netty.NettyAsyncHttpProvider.updateBodyAndInterrupt(NettyAsyncHttpProvider.java:1568)

at com.ning.http.client.providers.netty.NettyAsyncHttpProvider.access $ 2900(NettyAsyncHttpProvider.java:161)at com.ning.http.client.providers.netty.NettyAsyncHttpProvider $ HttpProtocol.handle(NettyAsyncHttpProvider.java:2233)at at com.ning.http.client.providers.netty.NettyAsyncHttpProvider.messageReceived(NettyAsyncHttpProvider.java:1227)位于org.jboss.netty的org.jboss.netty.handler.stream.ChunkedWriteHandler.handleUpstream(ChunkedWriteHandler.java:142). channel.Channels.fireMessageReceived(Channels.java:296)位于org.jboss.netty.handler.codec.replay.ReplayingDecoder的org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:459). 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.c的org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268)hannel.Channels.fireMessageReceived(Channels.java:255)位于org.jboss.netty.channel.socket.nio.AbstractNioWorker的org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88).进程(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)atg.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)at java.util.concurrent java.lang.Thread.run中的.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:615)(Thread.java:724)

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

请帮我.

Pri*_*sai 11

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

以下修正了它:

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

val conf = ConfigFactory.load(parsedConfig)
Run Code Online (Sandbox Code Playgroud)

  • 以上"val parsedConfig = ..."去哪儿了?什么用"val conf"? (3认同)