Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 
like image 918
Ishan Kumar Avatar asked Sep 07 '25 11:09

Ishan Kumar


1 Answers

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.

like image 150
Ishan Kumar Avatar answered Sep 10 '25 01:09

Ishan Kumar