简体   繁体   中英

Why does Play Framework 2.3.8 Deployment not work?

I have written a program with the play framework 2.3.8 named quizSystem . It is using a memory database, some controller, viewclasses etc.

Now I want to run my program on another machine (windows 7 with JDK 8u45 installed and the PATH set to the JDK), therefore I ran activator dist on machine 1 and got a .zip-File with a snapshot of my program. I copied this zip file to machine 2, extracted it and used the console to go to the /bin folder. In there are 2 files quizSystem and quizSystem.bat .

So I typed quizSystem

Error: Oops, cannot start the server ... Database 'default' needs evolution

So I tried this: quizSystem -DapplyEvolutions=true
Error: Bad application path: -DapplyEvolutions=true

So then I added the line applyEvolutions=true into the application.conf file.

But still, no matter which command I use I can start the program. I have searched and tried many solutions like here: Play Framework 2.1.1 Deployment Issues

Why is the evolution / my program not working?

Found the solution:

There seems to be an (open?) bug in the play framework at the moment: https://github.com/playframework/playframework/issues/3081

If I understand correctly the order of the input parameters for java is the wrong way around in the play framework. Thats the reason that manual input in the console produces an error...

So here is the complete list of steps in order to produce a working program for deployment:

1) In your directory type activator dist into console

2) You get a zip file in the /target/universal directory (something that contains the word SNAPSHOT or similar

3) On your target machine you need an installed JDK, goto here: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

4) Extract your zip-file, in the /bin -folder edit the .bat file

5) search for set "APP_MAIN_CLASS=play.core.server.NettyServer" and change to

set "APP_MAIN_CLASS= -DapplyEvolutions.default=true play.core.server.NettyServer"

6) Then simply use the console to navigate to the folder and type the name of your program

I hope this spares somebody else several hours of frustration, despair

and lots of shouting and cursing :D

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM