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

Adding a JVM parameter to application.conf file causes errors #28

Open
saurabhsharma721 opened this issue Dec 19, 2019 · 1 comment
Open

Comments

@saurabhsharma721
Copy link

Versions used

Akka version: "2.5.25"

Expected Behavior

Please describe the expected behavior of the issue, starting from the first action.

In Scala grpc quickstart if we add any new property in application.conf which reads values from Jvm parameters, the application crashes in config reading.

Actual Behavior

Please provide a description of what actually happens, working from the same starting point.

In Scala quick start project add following lines in application.conf

testproject {
log-level = "INFO"
log-level = ${?LOG_LEVEL}
}

This log-level is supposed to command line parameter set by our cloud formation project.

This causes the project to fail while starting up.

Relevant logs

If you identified a section in your logs that explains the bug or might be important to understand it, please add it.

Exception in thread "main" com.typesafe.config.ConfigException$NotResolved: need to Config#resolve() each config before using it, see the API docs for Config#resolve()
at com.typesafe.config.impl.SimpleConfig.checkValid(SimpleConfig.java:1103)
at akka.actor.ActorSystem$Settings.(ActorSystem.scala:322)
at akka.actor.ActorSystemImpl.(ActorSystem.scala:703)
at akka.actor.ActorSystem$.apply(ActorSystem.scala:258)
at akka.actor.ActorSystem$.apply(ActorSystem.scala:302)
at akka.actor.ActorSystem$.apply(ActorSystem.scala:276)
at com.example.helloworld.GreeterServer$.main(GreeterServer.scala:26)
at com.example.helloworld.GreeterServer.main(GreeterServer.scala)

Reproducible Test Case

Please provide a PR with a failing test.

If the issue is more complex or requires configuration, please provide a link to a project that reproduces the issue.

@raboof
Copy link
Member

raboof commented Dec 19, 2019

Thank you for your report! I had a quick look, and the problem is where it says .withFallback(ConfigFactory.defaultApplication()) this should be .withFallback(ConfigFactory.load()).

Would you be interested in testing if this fixes the problem for you, and perhaps even providing a PR to fix the quickstart project?

@raboof raboof transferred this issue from akka/akka-grpc Dec 19, 2019
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