Deploy playframework without java logging instance
-
11-12-2019 - |
Question
Hi guys so I have written my play application and all is working fine.
I am installing this on a windows machine, and I need it to be up 24/7. I want it all to be automatic so the user does not have to go into command and run play start everytime the computer restarts or there is an issue.
So I wrote a c# wrapper service that monitors the RUNNING_PID to check if the service is running, if not opens a new cmd prompt and runs play start.
So this is working atm, but when you run play start it opens up two java processes 1 being the actual service and the other is a logging service.
Is there a way to not have this open? either a configuration option or extra launch parameter?
Any other ideas on how I could get around this?
Ive had a look at using stage and dist but I've found they dont work. once the file is created the new start command doesnt do anything.
Solution
Hi guys so I found a solution.
Using dist now and then creating a new start.bat file with the below script:
@echo off
if "%OS%" == "Windows_NT" (
set "DIRNAME=%~dp0%"
) else (
set DIRNAME=.\
)
java -cp "%DIRNAME%\lib\*" %* play.core.server.NettyServer
I solution was solved here: https://plus.google.com/u/0/108788785914419775677/posts/RxohCRp52J5
I'm still not sure how to automatically include this new script file into the dist zip file. If anyone knows how to do this would be helpful?