Open fluency03 opened 6 years ago
Seems like it happens when application tries to load file from the same directory where it has been run without any path mention (I omitted insignificant lines):
~/workspace$ cat <<END >basic.conf
> property: 5
> END
~/workspace$ cat <<END >envelope.conf
> envelope {
> include required("basic")
> }
> END
~/workspace$ amm
...
@ import $ivy.`com.typesafe:config:1.3.4`
import $ivy.$
@ com.typesafe.config.ConfigFactory.parseFile(new java.io.File("envelope.conf"))
com.typesafe.config.ConfigException$IO: basic: basic.conf: java.io.FileNotFoundException: include was not found: 'basic.conf', basic.json: java.io.FileNotFoundException: include was not found: 'basic.json', basic.properties: java.io.FileNotFoundException: include was not found: 'basic.properties'
...
@ com.typesafe.config.ConfigFactory.parseFile(new java.io.File(sys.env("PWD") + "/envelope.conf"))
res6: com.typesafe.config.Config = Config(SimpleConfigObject({"envelope":{"property":5}}))
@ com.typesafe.config.ConfigFactory.parseFile(new java.io.File("./envelope.conf"))
res7: com.typesafe.config.Config = Config(SimpleConfigObject({"envelope":{"property":5}}))
@ Bye!
~/workspace$ cd ..
~$ amm
...
@ import $ivy.`com.typesafe:config:1.3.4`
import $ivy.$
@ com.typesafe.config.ConfigFactory.parseFile(new java.io.File("workspace/envelope.conf"))
res1: com.typesafe.config.Config = Config(SimpleConfigObject({"envelope":{"property":5}}))
So there is a workaround: just add "./" or another path to argument.
But definitely it is a bug...
same issue !
@eshu Did you try include required("basic.conf")
?
@eshu Did you try
include required("basic.conf")
? I tried that ! Did not work
I am having problem with using the keyword
required
for including another file.This is NOT working:
I got:
This is working: