Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Universal binary 'No configuration setting found for key 'username' #6

Open
theobarberbany opened this issue Feb 17, 2018 · 1 comment

Comments

@theobarberbany
Copy link

theobarberbany commented Feb 17, 2018

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 :)

@ruippeixotog
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants