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

application.ini incorrect line ending => application can't start #4921

Closed
giabao opened this issue Jul 31, 2015 · 3 comments
Closed

application.ini incorrect line ending => application can't start #4921

giabao opened this issue Jul 31, 2015 · 3 comments

Comments

@giabao
Copy link
Contributor

giabao commented Jul 31, 2015

  1. build.sbt

    javaOptions in Universal += "-Dlogger.file=conf/logback-prod.xml"
  2. sbt dist from a Windows machine.

  3. run in linux => error:

    Error encountered while configuring logback:
    ch.qos.logback.core.joran.spi.JoranException: Could not open URL [file:/var/www/api-3.20-SNAPSHOT/conf/logback-prod.xml%0D].
        at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:53)
        at play.api.Logger$.configure(Logger.scala:278)
        at play.api.Logger$.configure(Logger.scala:232)
        at play.api.inject.guice.GuiceApplicationBuilder.applicationModule(GuiceApplicationBuilder.scala:73)
        at play.api.inject.guice.GuiceBuilder.injector(GuiceInjectorBuilder.scala:126)
        at play.api.inject.guice.GuiceApplicationBuilder.build(GuiceApplicationBuilder.scala:93)
        at play.api.inject.guice.GuiceApplicationLoader.load(GuiceApplicationLoader.scala:21)
        at play.core.server.ProdServerStart$.start(ProdServerStart.scala:52)
        at play.core.server.ProdServerStart$.main(ProdServerStart.scala:27)
        at play.core.server.ProdServerStart.main(ProdServerStart.scala)
    (No such file or directory)undException: /var/www/api-3.20-SNAPSHOT/conf/logback-prod.xml
          at java.io.FileInputStream.open0(Native Method)
          at java.io.FileInputStream.open(FileInputStream.java:195)
          at java.io.FileInputStream.<init>(FileInputStream.java:138)
          at java.io.FileInputStream.<init>(FileInputStream.java:93)
          at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
          at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
          at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:48)
          ... 9 more
    
  4. if before run the app, I run the following command to remove \r:

sed -i.bak 's/\r$//' conf/application.ini

=> OK

@giabao
Copy link
Contributor Author

giabao commented Jul 31, 2015

I run play 2.4.2

@nafg
Copy link
Contributor

nafg commented Jul 31, 2015

Doesn't sound like a play issue, either it's a logback issue or it's just
different platforms are incompatible.
But who created this file with such line endings?
And since when does play use .ini?

On Fri, Jul 31, 2015, 2:36 AM giabao [email protected] wrote:

I run play 2.4.2


Reply to this email directly or view it on GitHub
#4921 (comment)
.

@giabao
Copy link
Contributor Author

giabao commented Aug 2, 2015

This is a bug of sbt-native-packager which is used by Play.

See sbt/sbt-native-packager#637

Steps to reproduce the bug: https://github.com/giabao/native-packager-test

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

No branches or pull requests

3 participants