ebay-snipe-server
ebay-snipe-server copied to clipboard
Universal binary 'No configuration setting found for key 'username'
Hi,
I have had success running the server locally, using 'sbt run' and then querying using httpie, however my production environment does not have enough memory to build / run, so I'm using a binary created by executing sbt universal:packageBin
from the root directory of the project.
Upon extracting the zip created at /target/universal
, and running the executable in the .zip I'm encountering the following error on the local (build) and production machines.
When building account details are in src/main/resources/application.conf
$ ./ebay-snipe-server
Exception in thread "main" com.typesafe.config.ConfigException$Missing: No configuration setting found for key 'username'
at com.typesafe.config.impl.SimpleConfig.findKeyOrNull(SimpleConfig.java:152)
at com.typesafe.config.impl.SimpleConfig.findOrNull(SimpleConfig.java:170)
at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:184)
at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:189)
at com.typesafe.config.impl.SimpleConfig.getString(SimpleConfig.java:246)
at net.ruippeixotog.ebaysniper.SnipeServer$.delayedEndpoint$net$ruippeixotog$ebaysniper$SnipeServer$1(SnipeServer.scala:25)
at net.ruippeixotog.ebaysniper.SnipeServer$delayedInit$body.apply(SnipeServer.scala:20)
at scala.Function0.apply$mcV$sp(Function0.scala:34)
at scala.Function0.apply$mcV$sp$(Function0.scala:34)
at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
at scala.App.$anonfun$main$1$adapted(App.scala:76)
at scala.collection.immutable.List.foreach(List.scala:389)
at scala.App.main(App.scala:76)
at scala.App.main$(App.scala:74)
at net.ruippeixotog.ebaysniper.SnipeServer$.main(SnipeServer.scala:20)
at net.ruippeixotog.ebaysniper.SnipeServer.main(SnipeServer.scala)
Any help greatly appreciated :)
Hi! The problem is that your application.conf
is not being used, and therefore it can't find the credentials.
On this project, application.conf
is not packaged inside the JAR file. When you build a Docker image, application.conf
is placed in a conf
folder inside the image that also gets used in runtime. If you're using universal:packageBin
you have to make sure that application.conf
is in your classpath manually. For example, you can put your application.conf
in your working directory from which you launch the JAR.