0

I have a small play app which I'd like to offload to another computer and keep it running whenever the computer is on, whether or not anyone is logged in etc.

I had believed the best to do this is as a windows service. How do I run a Play Framework 2.0 application as a Windows service?

This link lays out excellent instructions, however, when I attempt step 10 - installService.bat, it says service NOT installed.

Looking up through the message, it appears to say "error 1783 the stub recieved bad data."

Has anyone seen this before ? Can anyone shed light on this cryptic message?

A Config B Config

Community
  • 1
  • 1
Simon
  • 323
  • 2
  • 15
  • P.S I am running the command as administrator :-) – Simon Mar 23 '16 at 15:32
  • I give the system information. Have you installed latest update from windows? – Santhoshle Mar 25 '16 at 03:07
  • Yes, windows is up to date – Simon Mar 29 '16 at 09:38
  • Does application works with runConsole cmd? Also you list your system configuration. – Santhoshle Mar 30 '16 at 02:46
  • Yes. It works with 'runConsole.bat' so that I'm able to visit a 'localhost' webpage. If I terminate that batch job, the page doesn't exist anymore, so that appears to work fine. – Simon Apr 06 '16 at 14:59
  • I'm not totally sure what you mean by 'system configration'. If I type that at the start menu, and search for System Configuration, I get to a windows system config. Do the screenshots above help? – Simon Apr 06 '16 at 15:02
  • Check ur classpath(lib folder) and working dir path in wrapper.conf file – Santhoshle Apr 14 '16 at 18:13

1 Answers1

1

So, I think I've found the answer to this... the problem is kind of stupid in hindsight... when yajsw generates wrapper.conf, it also auto generates a series of fields, such as;

wrapper.ntservice.displayname=\"RiskFactors" -cp"\\lots\and\lots\...\" of\filenames\which\get\stupidly\long

There are about 4 of these. I hadn't appreciated, that these are only names, rather than something smart yajsw needed. What I think is happening is that YAJSW was feeding the entire line... including all the extra gumpf to the windows services manager, which fed back the (un)helpful response; 'the stub recieved bad data'.

The 'bad data' that generates error 1783 is the service name I'm trying to install... which is about 700 characters long with a bunch of special characters. If you hit the same problem modify these lines in wrapper.conf;

wrapper.ntservice.name
wrapper.ntservice.displayname
wrapper.console.title
wrapper.ntservice.description

To be sensible, for example

wrapper.ntservice.name=MyService

After this, everything burst into life.

@LES - thanks for the hint.

Simon
  • 323
  • 2
  • 15