Play Framework 2.1.1 Deployment Issues

So, I'm trying to deploy my very simple Play Framework 2.1.1 application, but whenever I pass the checkboxes through the command line for the port and apply the database evolution, they are ignored.

For instance:

sudo play start -Dhttp.port = 80 -DapplyEvolutions.default = true

Using this command, the server will not start. Both the port flag and applyEvolutions = true are completely ignored, and it causes this error:

[warn] play - Your production database [default] needs evolution! [warn] play - Starting with -DapplyEvolutions.default = true if you want to start them automatically (be careful) Unfortunately, the server cannot be started. @ 6elhl9mca: the database requires default!

I tried everything that I could think of to no avail. Using Play Run on my local machine works fine, no problem. The server runs Ubuntu 12.04. All suitable drivers and connection strings are present and tested, the database is running, everything works without problems, except for the Play Framework.

+6
source share
2 answers

Ok, so I really did not find a solution for this, but I found a workaround. This is nowhere in the documentation of the Play Framework 2.x (for now), so I suppose I will put it here if someone gets stuck:

Putting applyEvolutions.default=true in application.conf WORKS and do an automatic database change. The command line -DapplyEvolutions.default=true does NOT work and is ignored for unknown reasons.

Putting http.port=80 in application.conf does NOT work . The command line -Dhttp.port=80 also does NOT WORK to set the port number to run.

So, to set the port number, use this command:

play "start 80" or play "run 80" (use double quotes exactly as shown).

For some reason, when the port command is written in exactly the same way as above, in double quotes, the port number to start is set correctly.

This is not found in infrastructure documentation anywhere. I would create another migration request to add it, but the last problem I solved for this structure (database encryption) was outlined as a โ€œlimited use case in a nicheโ€, and thus the documentation update was refused . I can still try.

Hope this helps someone.

+6
source

Or

 play "start -Dhttp.port=80 -DapplyEvolutions.default=true" 

or

 play dist 

then unzip and run the generated script run,

 ./start -Dhttp.port=80 -DapplyEvolutions.default=true 

will work.

+10
source

Source: https://habr.com/ru/post/948013/


All Articles