I am using typeSafe config to load the properties from application.properties present under src/main/resources into Scala code. While running the code from eclipse, the properties are getting loaded. But while running as a jar file,its throwing me an error.
com.typesafe.config.ConfigException$Missing: No configuration setting found for key
Thanks Wang for giving me a clue. Yes, the jar file contains the property file. But it was not able to find the file, as the property file was present in resouces folder. I got to know when I unzip the jar file. In code had provided the below.
val config=ConfigFactory.load("application.properties")
When i changed it to-
val config=ConfigFactory.load("resources/application.properties")
i am getting the properties. THANKS ALL.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With