Run any Play Framework Application as a Windows Service

How to Run a Play Framework Application as a Windows Service with AlwaysUp

Start your Java/Scala web application when your PC boots and keep it running 24x7 in the background. No need to log on!

The Play Framework is a modern development environment focusing on the construction of highly scalable web applications in Java and Scala.

To configure a Play Framework application with AlwaysUp 8.0 and later:

  1. Download and install Play, if necessary. Please make a note of where you put it. We extracted the zip file to C:\play and we will use that location throughout this tutorial.

  2. Download and install AlwaysUp, if necessary.

  3. Start AlwaysUp.

  4. Select Application > Add to open the Add Application window:

    Add Application

  5. On the General tab:

    • In the Application field, enter the full path to the play batch file that starts your application, play.bat. Since our Play package lives in C:\play, this is:

      C:\play\play.bat
      Of course, your location will almost surely be different!

    • In the Arguments field, enter run. This instructs the batch file to immediately start the application instead of responding with a prompt.

    • In the Start in directory field, enter the folder containing your Play application. Since we are running the sample forms Java application, this is:

      C:\play\samples\java\forms

    • In the Name field, enter the name that you will call the application in AlwaysUp. We have entered Play Forms but you can specify almost anything you like.

    Play Framework Application Windows Service: General Tab

  6. Though probably not required, we recommend that you click over to the LogOn tab and enter the user name and password of the account in which you installed and run your Play application normally. This should only be necessary if you application requires resources not available to the default system account (network drives, printers, etc).

    Play Framework Application Windows Service: LogOn Tab

  7. Click over to the Startup tab and check the Ensure that the Windows Networking components have started box. This informs AlwaysUp that your Play application needs TCP/IP networking support to do its work.

    Play Framework Application Windows Service: Startup Tab

  8. Click the Save >> button. In a couple of seconds, an application called Play Forms will show up in the AlwaysUp window. It is not yet running though.

    Play Framework Application Windows Service: Created

  9. To start the application from AlwaysUp, choose Application > Start "Play Forms" (but with your application's name instead). The status will change to Running and after a few seconds you should be able to access your application in the browser:

    Play Framework Application Windows Service: Running

    On Windows 8, 7, Vista, Server 2012 or 2008, your application will be running in Session 0. If you wish to see the familiar console, select Tools > Switch to Session 0 to transport yourself to the strange looking Session 0 desktop where Play's window will be visible:

    Play Framework Application Windows Service: Running in Session 0

    Click the Return now button to go back to your regular desktop.

  10. That's it! Next time your computer boots, your Play application will start up immediately, without anyone needing to log on. Please restart your PC now and test that the application works as expected after Windows comes back to life.

    And please feel free to edit your configuration in AlwaysUp to check out the many other settings that may be appropriate for your environment. For example, send email alerts, boost priority, capture text from the console, etc.



Play Application not working properly as a Windows Service?

  • Review the console window for errors. If you come across any, please establish a baseline by ensuring that your application runs normally without AlwaysUp involved.
  • From AlwaysUp, select Application > Report Activity > Today... to bring up a HTML report detailing the interaction between AlwaysUp and your application. The AlwaysUp Event Log Messages page explains the more obscure messages.
  • Consult the AlwaysUp FAQ for answers to commonly asked questions and troubleshooting tips.
  • Contact us and we will be happy to help!

Download & Try it Free!

Download AlwaysUp and Run as a Service Today! Version 9.7 New!

4.6 MB Installer
  • Unrestricted 30-day trial for new users; upgrade for existing users
  • Windows 10/8.1/8/7/XP & Windows Server 2012 R2/2008/2003
  • How to Install | EULA
Our customers include...


Compatible with Windows 10 (32 & 64-bit)

Windows Server 2012 Certified (32 & 64-bit)

Windows 8 Compatible (32 & 64-bit)

Compatible with Windows 7 (32 & 64-bit)

Works with Windows Server 2008 R2 (32 & 64-bit)



Over 68,000 installations, and counting!
 
AlwaysUp is number 1! Run as a Service with AlwaysUp

Rock-solid for the past 10+ years!