0

We have developed a jar that gets wrapped as a Windows service using Procrun, the Apache Commons Daemon component for windows services. Everything works well on my own computer and on a few other development machines, but when we installed it in a production environment (Windows Server 2008) we begun getting weird behaviours.

First, after starting and stopping the service, for some reason, Java stops working. Typing a classical "java -version" on any command prompt yields absolutely no output. Attempting to launch any Java applications has absolutely no effect. The only solution is to reinstall the JRE all over again. If you stop and start the service after reinstalling the JRE it gets broken all over again.

Another weird thing that's been happening. Sometimes, when using prunmgr to manage our service (after renaming it to our service's name, say "MYSERVICE"), it gives us a message saying that the service "gMYSERVICE" isn't installed. It seems to think, in some cases, that our service has a 'g' appended to it. Sometimes two extra hidden files, possibly copies of prunsrv and prunmgr exist, with a 'g' appended to them, as in gprunsrv.exe and gMYSERVICE.exe. Those files can't be seen using the system explorer, even with hidden files mode on, but can be detected by teamviewer.

Eduardo Z.
  • 633
  • 3
  • 10
  • 32
  • Is there anything else on the host which may be interacting with the service? Lack of memory, lack of cpu? The fact that 'java --version' fails suggests that there's a problem starting up a new process. Any errors in the system logs? – sisyphus May 02 '16 at 23:09
  • There doesn't seem to be anything of the sort. CPU and memory are ok. We'll check the system logs later to see if anything shows up there. – Eduardo Z. May 03 '16 at 15:17
  • Nothing interesting shows up on the system logs. We see the service starting and stopping, and Windows sometimes complaining about the service not being installed, with a couple timeouts. Nothing enlightening, however. – Eduardo Z. May 03 '16 at 18:04
  • 1
    It seems [Java Service Wrapper](http://wrapper.tanukisoftware.com/doc/english/download.jsp) is under more active development in compare with Apache Commons Daemon - Procrun. So you may get better result with it(I use it in Windows 2012 without any problem). – SidMorad May 08 '16 at 18:59

0 Answers0