com.typesafe.config.ConfigException$Missing: No configuration setting found for key 'play'

Alex picture Alex · Jun 18, 2015 · Viewed 10.3k times · Source

I work in a sbt project, and i am using library play-ws.
but my application does not play framework.

So, when i run mi Job, i have this error:

com.typesafe.config.ConfigException$Missing: No configuration setting found for key 'play'

com.typesafe.config.ConfigException$Missing: No configuration setting found for key 'play' at com.typesafe.config.impl.SimpleConfig.findKey(SimpleConfig.java:124) at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:145) at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:159) at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:164) at com.typesafe.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) at 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$Implicits$.defaultContext(Execution.scala:12) at play.api.libs.ws.ning.NingWSRequest$$anon$2.onBodyPartReceived(NingWS.scala:322)No configuration setting found for key 'play' at com.ning.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 com.ning.http.client.providers.netty.NettyAsyncHttpProvider.messageReceived(NettyAsyncHttpProvider.java:1227) at org.jboss.netty.handler.stream.ChunkedWriteHandler.handleUpstream(ChunkedWriteHandler.java:142) at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296) at org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:459) at org.jboss.netty.handler.codec.replay.ReplayingDecoder.callDecode(ReplayingDecoder.java:536) at org.jboss.netty.handler.codec.replay.ReplayingDecoder.messageReceived(ReplayingDecoder.java:435) at org.jboss.netty.handler.codec.http.HttpClientCodec.handleUpstream(HttpClientCodec.java:92) at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268) at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255) at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88) at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:108) at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:318) at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89) at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:724)

(I use sby assembly to make a jar and execute the job in spark job-server) I dont use files configuration(application.conf, reference.conf, etc) in my job.

Please help me.

Answer

Priyank Desai picture Priyank Desai · Aug 5, 2015

I don't know what was causing the problem.

The following fixed it:

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

val conf = ConfigFactory.load(parsedConfig)