Search code examples
playframeworkyajsw

Play Framework with YAJSW : error during stall, the stub recieved bad data


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


Solution

  • 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.